diff --git a/tests/panels/test_template.py b/tests/panels/test_template.py index eb23cde31..2bd02bf1d 100644 --- a/tests/panels/test_template.py +++ b/tests/panels/test_template.py @@ -1,3 +1,5 @@ +from unittest import expectedFailure + import django from django.contrib.auth.models import User from django.template import Context, RequestContext, Template @@ -135,11 +137,12 @@ 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, "

Templates (2 rendered)

") - self.assertContains(r, "jinja2/basic.jinja") + self.assertContains(r, "basic.jinja") def context_processor(request): diff --git a/tests/templates/jinja2/base.html b/tests/templates/jinja2/base.html new file mode 100644 index 000000000..ea0d773ac --- /dev/null +++ b/tests/templates/jinja2/base.html @@ -0,0 +1,9 @@ + + + + {{ title }} + + + {% block content %}{% endblock %} + + diff --git a/tests/templates/jinja2/basic.jinja b/tests/templates/jinja2/basic.jinja index 812acbcac..e531eee64 100644 --- a/tests/templates/jinja2/basic.jinja +++ b/tests/templates/jinja2/basic.jinja @@ -1,2 +1,5 @@ {% extends 'base.html' %} -{% block content %}Test for {{ title }} (Jinja){% endblock %} +{% block content %} +Test for {{ title }} (Jinja) +{% for i in range(10) %}{{ i }}{% endfor %} {# Jinja2 supports range(), Django templates do not #} +{% endblock %} diff --git a/tests/views.py b/tests/views.py index c7214029e..8ae4631fe 100644 --- a/tests/views.py +++ b/tests/views.py @@ -48,7 +48,7 @@ def json_view(request): def regular_jinjia_view(request, title): - return render(request, "jinja2/basic.jinja", {"title": title}) + return render(request, "basic.jinja", {"title": title}, using="jinja2") def listcomp_view(request):