summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests/test_basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests/syntax_tests/test_basic.py')
-rw-r--r--tests/template_tests/syntax_tests/test_basic.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/template_tests/syntax_tests/test_basic.py b/tests/template_tests/syntax_tests/test_basic.py
index b72d6e6414..da45fe2839 100644
--- a/tests/template_tests/syntax_tests/test_basic.py
+++ b/tests/template_tests/syntax_tests/test_basic.py
@@ -323,3 +323,12 @@ class BasicSyntaxTests(SimpleTestCase):
msg = "Unclosed tag 'if'. Looking for one of: elif, else, endif."
with self.assertRaisesMessage(TemplateSyntaxError, msg):
self.engine.render_to_string('template')
+
+ @setup({'tpl-str': '%s', 'tpl-percent': '%%', 'tpl-weird-percent': '% %s'})
+ def test_ignores_strings_that_look_like_format_interpolation(self):
+ output = self.engine.render_to_string('tpl-str')
+ self.assertEqual(output, '%s')
+ output = self.engine.render_to_string('tpl-percent')
+ self.assertEqual(output, '%%')
+ output = self.engine.render_to_string('tpl-weird-percent')
+ self.assertEqual(output, '% %s')