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 6004f59 commit a6b4fba
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/panels/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,23 @@ 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)")
self.assertContains(r, "<h3>Templates (2 rendered)</h3>")
# 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 (1 rendered)</h3>")
self.assertContains(r, "<small>basic.jinja</small>")


Expand Down

0 comments on commit a6b4fba

Please sign in to comment.