From 67b4429458886070895dd1d62f1fbfbaaa68e9cd Mon Sep 17 00:00:00 2001 From: egberts Date: Mon, 22 Jul 2024 20:10:41 -0500 Subject: [PATCH] Fix test_generators.py --- pelican/tests/test_generators.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index e739e180..c1dd177d 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -1122,8 +1122,11 @@ class TestPageGenerator(unittest.TestCase): Test to ensure links of the form {static}filename and {attach}filename are included in context['static_links'] """ + tests_subdir = os.path.dirname(__file__) + testpages_subdir = tests_subdir + os.sep + "TestPages" + page_w_static_links = testpages_subdir + os.sep + "page_with_static_links.md" settings = get_settings() - settings["PAGE_PATHS"] = ["TestPages/page_with_static_links.md"] + settings["PAGE_PATHS"] = [page_w_static_links] settings["CACHE_PATH"] = self.temp_cache settings["DEFAULT_DATE"] = (1970, 1, 1) context = get_context(settings) @@ -1137,8 +1140,8 @@ class TestPageGenerator(unittest.TestCase): ) generator.generate_context() - self.assertIn("pelican/tests/TestPages/image0.jpg", context["static_links"]) - self.assertIn("pelican/tests/TestPages/image1.jpg", context["static_links"]) + self.assertIn("TestPages/image0.jpg", context["static_links"]) + self.assertIn("TestPages/image1.jpg", context["static_links"]) class TestTemplatePagesGenerator(TestCaseWithCLocale):