mirror of
https://github.com/django/django.git
synced 2025-07-23 21:25:40 +00:00
Fixed #17356 -- Allowed {% include %} to render compiled templates
Reviewed by Loic Bistuer and Tim Graham.
This commit is contained in:
parent
169637649b
commit
5cdacbda03
4 changed files with 27 additions and 2 deletions
|
@ -338,6 +338,17 @@ class TemplateLoaderTests(TestCase):
|
|||
loader.template_source_loaders = old_loaders
|
||||
settings.TEMPLATE_DEBUG = old_td
|
||||
|
||||
def test_include_template_argument(self):
|
||||
"""
|
||||
Support any render() supporting object
|
||||
"""
|
||||
ctx = Context({
|
||||
'tmpl': Template('This worked!'),
|
||||
})
|
||||
outer_tmpl = Template('{% include tmpl %}')
|
||||
output = outer_tmpl.render(ctx)
|
||||
self.assertEqual(output, 'This worked!')
|
||||
|
||||
|
||||
class TemplateRegressionTests(TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue