Skip to content

Commit

Permalink
Improve the jinja tests to better indicate the situation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schilling committed Jul 5, 2024
1 parent c8f6763 commit 4fd886b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/panels/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<h3>Templates (1 rendered)</h3>")
self.assertContains(r, "<small>basic.jinja</small>")

@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, "<h3>Templates (2 rendered)</h3>")
Expand Down

0 comments on commit 4fd886b

Please sign in to comment.