From ac4069827cd68ff2c5dd4a18aff569064fc4c97d Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Thu, 4 Jul 2024 20:42:18 -0500 Subject: [PATCH] Improve the jinja tests to better indicate the situation. --- tests/panels/test_template.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/panels/test_template.py b/tests/panels/test_template.py index 2bd02bf1d..636e88a23 100644 --- a/tests/panels/test_template.py +++ b/tests/panels/test_template.py @@ -137,8 +137,20 @@ def test_lazyobject_eval(self): DEBUG=True, DEBUG_TOOLBAR_PANELS=["debug_toolbar.panels.templates.TemplatesPanel"] ) class JinjaTemplateTestCase(IntegrationTestCase): - @expectedFailure def test_django_jinja2(self): + r = self.client.get("/regular_jinja/foobar/") + self.assertContains(r, "Test for foobar (Jinja)") + # This should be 2 templates because of the parent template. + # See test_django_jinja2_parent_template_instrumented + self.assertContains(r, "

Templates (1 rendered)

") + self.assertContains(r, "basic.jinja") + + @expectedFailure + def test_django_jinja2_parent_template_instrumented(self): + """ + When Jinja2 templates are properly instrumented, the + parent template should be instrumented. + """ r = self.client.get("/regular_jinja/foobar/") self.assertContains(r, "Test for foobar (Jinja)") self.assertContains(r, "

Templates (2 rendered)

")