summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests/test_debug.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests/syntax_tests/test_debug.py')
-rw-r--r--tests/template_tests/syntax_tests/test_debug.py47
1 files changed, 23 insertions, 24 deletions
diff --git a/tests/template_tests/syntax_tests/test_debug.py b/tests/template_tests/syntax_tests/test_debug.py
index 2f527b44ae..cbd71fa51a 100644
--- a/tests/template_tests/syntax_tests/test_debug.py
+++ b/tests/template_tests/syntax_tests/test_debug.py
@@ -6,41 +6,40 @@ from ..utils import setup
@override_settings(DEBUG=True)
class DebugTests(SimpleTestCase):
-
@override_settings(DEBUG=False)
- @setup({'non_debug': '{% debug %}'})
+ @setup({"non_debug": "{% debug %}"})
def test_non_debug(self):
- output = self.engine.render_to_string('non_debug', {})
- self.assertEqual(output, '')
+ output = self.engine.render_to_string("non_debug", {})
+ self.assertEqual(output, "")
- @setup({'modules': '{% debug %}'})
+ @setup({"modules": "{% debug %}"})
def test_modules(self):
- output = self.engine.render_to_string('modules', {})
+ output = self.engine.render_to_string("modules", {})
self.assertIn(
- ''django': <module 'django' ',
+ "'django': <module 'django' ",
output,
)
- @setup({'plain': '{% debug %}'})
+ @setup({"plain": "{% debug %}"})
def test_plain(self):
- output = self.engine.render_to_string('plain', {'a': 1})
- self.assertTrue(output.startswith(
- '{'a': 1}'
- '{'False': False, 'None': None, '
- ''True': True}\n\n{'
- ))
+ output = self.engine.render_to_string("plain", {"a": 1})
+ self.assertTrue(
+ output.startswith(
+ "{'a': 1}"
+ "{'False': False, 'None': None, "
+ "'True': True}\n\n{"
+ )
+ )
- @setup({'non_ascii': '{% debug %}'})
+ @setup({"non_ascii": "{% debug %}"})
def test_non_ascii(self):
group = Group(name="清風")
- output = self.engine.render_to_string('non_ascii', {'group': group})
- self.assertTrue(output.startswith(
- '{'group': <Group: 清風>}'
- ))
+ output = self.engine.render_to_string("non_ascii", {"group": group})
+ self.assertTrue(output.startswith("{'group': <Group: 清風>}"))
- @setup({'script': '{% debug %}'})
+ @setup({"script": "{% debug %}"})
def test_script(self):
- output = self.engine.render_to_string('script', {'frag': '<script>'})
- self.assertTrue(output.startswith(
- '{&#x27;frag&#x27;: &#x27;&lt;script&gt;&#x27;}'
- ))
+ output = self.engine.render_to_string("script", {"frag": "<script>"})
+ self.assertTrue(
+ output.startswith("{&#x27;frag&#x27;: &#x27;&lt;script&gt;&#x27;}")
+ )