Skip to content

Commit a6b4fba

Browse files
committed
Improve the jinja tests to better indicate the situation.
1 parent 6004f59 commit a6b4fba

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/panels/test_template.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,23 @@ 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):
142141
r = self.client.get("/regular_jinja/foobar/")
143142
self.assertContains(r, "Test for foobar (Jinja)")
144-
self.assertContains(r, "<h3>Templates (2 rendered)</h3>")
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+
"""
154+
r = self.client.get("/regular_jinja/foobar/")
155+
self.assertContains(r, "Test for foobar (Jinja)")
156+
self.assertContains(r, "<h3>Templates (1 rendered)</h3>")
145157
self.assertContains(r, "<small>basic.jinja</small>")
146158

147159

0 commit comments

Comments
 (0)