summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2011-03-10 18:42:24 +0000
committerLuke Plant <L.Plant.98@cantab.net>2011-03-10 18:42:24 +0000
commite9d27639470d2e76ce51a2522aedc69ff912de3e (patch)
tree5d1b32374640fbe2124b5f362542bc04b3e98aa8 /tests
parent3349b95db67440cd2bcd199578232e93d0e1b88c (diff)
Fixed #15572 - include with "only" option discards context properties (such as autoescape)
Thanks to dfoerster for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15795 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/templates/tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 46aedb3da6..cb831348ce 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -1031,6 +1031,10 @@ class Templates(unittest.TestCase):
'include11': ('{% include "basic-syntax03" only with second=2 %}', {'first': '1'}, (' --- 2', 'INVALID --- 2')),
'include12': ('{% include "basic-syntax03" with first=1 only %}', {'second': '2'}, ('1 --- ', '1 --- INVALID')),
+ # autoescape context
+ 'include13': ('{% autoescape off %}{% include "basic-syntax03" %}{% endautoescape %}', {'first': '&'}, ('& --- ', '& --- INVALID')),
+ 'include14': ('{% autoescape off %}{% include "basic-syntax03" with first=var1 only %}{% endautoescape %}', {'var1': '&'}, ('& --- ', '& --- INVALID')),
+
'include-error01': ('{% include "basic-syntax01" with %}', {}, template.TemplateSyntaxError),
'include-error02': ('{% include "basic-syntax01" with "no key" %}', {}, template.TemplateSyntaxError),
'include-error03': ('{% include "basic-syntax01" with dotted.arg="error" %}', {}, template.TemplateSyntaxError),