summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-02-11 06:51:57 -0500
committerGitHub <noreply@github.com>2017-02-11 06:51:57 -0500
commitfe2d2884345e1e6a1daadd76e9404c62791ab589 (patch)
treeb07b3dee22f17a846461c8c7037301d9055250f8 /tests/template_tests/syntax_tests
parent0595bca221825c0c6bd572a32f3bf9eff7069328 (diff)
Fixed #27722 -- Reallowed using django.Template in {% include %}.
Diffstat (limited to 'tests/template_tests/syntax_tests')
-rw-r--r--tests/template_tests/syntax_tests/test_include.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/template_tests/syntax_tests/test_include.py b/tests/template_tests/syntax_tests/test_include.py
index 1ef76c7011..904209ea8b 100644
--- a/tests/template_tests/syntax_tests/test_include.py
+++ b/tests/template_tests/syntax_tests/test_include.py
@@ -1,7 +1,7 @@
import warnings
from django.template import (
- Context, Engine, TemplateDoesNotExist, TemplateSyntaxError,
+ Context, Engine, TemplateDoesNotExist, TemplateSyntaxError, loader,
)
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango21Warning
@@ -277,6 +277,11 @@ class IncludeTests(SimpleTestCase):
output = outer_tmpl.render(ctx)
self.assertEqual(output, 'This worked!')
+ def test_include_from_loader_get_template(self):
+ tmpl = loader.get_template('include_tpl.html') # {% include tmpl %}
+ output = tmpl.render({'tmpl': loader.get_template('index.html')})
+ self.assertEqual(output, 'index\n\n')
+
def test_include_immediate_missing(self):
"""
#16417 -- Include tags pointing to missing templates should not raise