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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user