summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests/syntax_tests')
-rw-r--r--tests/template_tests/syntax_tests/test_autoescape.py12
-rw-r--r--tests/template_tests/syntax_tests/test_cache.py22
2 files changed, 20 insertions, 14 deletions
diff --git a/tests/template_tests/syntax_tests/test_autoescape.py b/tests/template_tests/syntax_tests/test_autoescape.py
index d58dfc9176..35debd5269 100644
--- a/tests/template_tests/syntax_tests/test_autoescape.py
+++ b/tests/template_tests/syntax_tests/test_autoescape.py
@@ -23,8 +23,10 @@ class AutoescapeTagTests(SimpleTestCase):
self.assertEqual(output, '<b>hello</b>')
# Autoescape disabling and enabling nest in a predictable way.
- @setup({'autoescape-tag04': '{% autoescape off %}'
- '{{ first }} {% autoescape on %}{{ first }}{% endautoescape %}{% endautoescape %}'})
+ @setup({
+ 'autoescape-tag04':
+ '{% autoescape off %}{{ first }} {% autoescape on %}{{ first }}{% endautoescape %}{% endautoescape %}'
+ })
def test_autoescape_tag04(self):
output = self.engine.render_to_string('autoescape-tag04', {'first': '<a>'})
self.assertEqual(output, '<a> &lt;a&gt;')
@@ -46,8 +48,10 @@ class AutoescapeTagTests(SimpleTestCase):
output = self.engine.render_to_string('autoescape-tag07', {'first': mark_safe('<b>Apple</b>')})
self.assertEqual(output, '<b>Apple</b>')
- @setup({'autoescape-tag08': r'{% autoescape on %}'
- r'{{ var|default_if_none:" endquote\" hah" }}{% endautoescape %}'})
+ @setup({
+ 'autoescape-tag08':
+ r'{% autoescape on %}{{ var|default_if_none:" endquote\" hah" }}{% endautoescape %}'
+ })
def test_autoescape_tag08(self):
"""
Literal string arguments to filters, if used in the result, are safe.
diff --git a/tests/template_tests/syntax_tests/test_cache.py b/tests/template_tests/syntax_tests/test_cache.py
index 2039e7808c..7f7a6cd2cb 100644
--- a/tests/template_tests/syntax_tests/test_cache.py
+++ b/tests/template_tests/syntax_tests/test_cache.py
@@ -100,16 +100,18 @@ class CacheTagTests(SimpleTestCase):
"""
Regression test for #11270.
"""
- output = self.engine.render_to_string('cache17', {'poem': 'Oh freddled gruntbuggly/'
- 'Thy micturations are to me/'
- 'As plurdled gabbleblotchits/'
- 'On a lurgid bee/'
- 'That mordiously hath bitled out/'
- 'Its earted jurtles/'
- 'Into a rancid festering/'
- 'Or else I shall rend thee in the gobberwarts'
- 'with my blurglecruncheon/'
- 'See if I dont.'})
+ output = self.engine.render_to_string(
+ 'cache17',
+ {
+ 'poem': (
+ 'Oh freddled gruntbuggly/Thy micturations are to me/'
+ 'As plurdled gabbleblotchits/On a lurgid bee/'
+ 'That mordiously hath bitled out/Its earted jurtles/'
+ 'Into a rancid festering/Or else I shall rend thee in the gobberwarts'
+ 'with my blurglecruncheon/See if I dont.'
+ ),
+ }
+ )
self.assertEqual(output, 'Some Content')
@setup({'cache18': '{% load cache custom %}{% cache 2|noop:"x y" cache18 %}cache18{% endcache %}'})