summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/templates/27956_child.html3
-rw-r--r--tests/template_tests/templates/27956_parent.html5
-rw-r--r--tests/template_tests/tests.py12
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/template_tests/templates/27956_child.html b/tests/template_tests/templates/27956_child.html
new file mode 100644
index 0000000000..ea9aeb2197
--- /dev/null
+++ b/tests/template_tests/templates/27956_child.html
@@ -0,0 +1,3 @@
+{% extends "27956_parent.html" %}
+
+{% block content %}{% endblock %}
diff --git a/tests/template_tests/templates/27956_parent.html b/tests/template_tests/templates/27956_parent.html
new file mode 100644
index 0000000000..dad4fbbfe5
--- /dev/null
+++ b/tests/template_tests/templates/27956_parent.html
@@ -0,0 +1,5 @@
+{% load tag_27584 %}
+
+{% badtag %}{% endbadtag %}
+
+{% block content %}{% endblock %}
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
index 50ddee6674..4ec724db99 100644
--- a/tests/template_tests/tests.py
+++ b/tests/template_tests/tests.py
@@ -125,6 +125,18 @@ class TemplateTests(SimpleTestCase):
t.render(Context())
self.assertEqual(e.exception.template_debug['during'], '{% badtag %}')
+ def test_compile_tag_error_27956(self):
+ """Errors in a child of {% extends %} are displayed correctly."""
+ engine = Engine(
+ app_dirs=True,
+ debug=True,
+ libraries={'tag_27584': 'template_tests.templatetags.tag_27584'},
+ )
+ t = engine.get_template('27956_child.html')
+ with self.assertRaises(TemplateSyntaxError) as e:
+ t.render(Context())
+ self.assertEqual(e.exception.template_debug['during'], '{% badtag %}')
+
def test_super_errors(self):
"""
#18169 -- NoReverseMatch should not be silence in block.super.