mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Refs #15053 -- Clarified debug message when skipping templates to avoid recursion.
This commit is contained in:
parent
a1215a3237
commit
c70cd2a926
@ -17,7 +17,7 @@ class Loader:
|
||||
|
||||
for origin in self.get_template_sources(template_name):
|
||||
if skip is not None and origin in skip:
|
||||
tried.append((origin, 'Skipped'))
|
||||
tried.append((origin, 'Skipped to avoid recursion'))
|
||||
continue
|
||||
|
||||
try:
|
||||
|
@ -64,8 +64,13 @@ class ExtendsBehaviorTests(SimpleTestCase):
|
||||
"""
|
||||
engine = Engine(dirs=[os.path.join(RECURSIVE, 'fs')])
|
||||
template = engine.get_template('self.html')
|
||||
with self.assertRaises(TemplateDoesNotExist):
|
||||
with self.assertRaises(TemplateDoesNotExist) as e:
|
||||
template.render(Context({}))
|
||||
tried = e.exception.tried
|
||||
self.assertEqual(len(tried), 1)
|
||||
origin, message = tried[0]
|
||||
self.assertEqual(origin.template_name, 'self.html')
|
||||
self.assertEqual(message, 'Skipped to avoid recursion')
|
||||
|
||||
def test_extend_cached(self):
|
||||
engine = Engine(
|
||||
|
Loading…
Reference in New Issue
Block a user