Skip to content

Commit 4fd886b

Browse files
committed
Improve the jinja tests to better indicate the situation.
1 parent c8f6763 commit 4fd886b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/panels/test_template.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,20 @@ def test_lazyobject_eval(self):
137137
DEBUG=True, DEBUG_TOOLBAR_PANELS=["debug_toolbar.panels.templates.TemplatesPanel"]
138138
)
139139
class JinjaTemplateTestCase(IntegrationTestCase):
140-
@expectedFailure
141140
def test_django_jinja2(self):
141+
r = self.client.get("/regular_jinja/foobar/")
142+
self.assertContains(r, "Test for foobar (Jinja)")
143+
# This should be 2 templates because of the parent template.
144+
# See test_django_jinja2_parent_template_instrumented
145+
self.assertContains(r, "<h3>Templates (1 rendered)</h3>")
146+
self.assertContains(r, "<small>basic.jinja</small>")
147+
148+
@expectedFailure
149+
def test_django_jinja2_parent_template_instrumented(self):
150+
"""
151+
When Jinja2 templates are properly instrumented, the
152+
parent template should be instrumented.
153+
"""
142154
r = self.client.get("/regular_jinja/foobar/")
143155
self.assertContains(r, "Test for foobar (Jinja)")
144156
self.assertContains(r, "<h3>Templates (2 rendered)</h3>")

0 commit comments

Comments
 (0)