1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

[1.11.x] Fixed #27956 -- Fixed display of errors in an {% extends %} child.

Thanks Ling-Xiao Yang for the report and test, and
Preston Timmons for the fix.

Backport of e643ba8bcf from master
This commit is contained in:
Tim Graham
2017-03-25 08:22:12 -04:00
parent b6a6787fd8
commit 8cc2f5aed1
5 changed files with 27 additions and 4 deletions

View File

@@ -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.