summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests/test_debug.py
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2022-02-03 20:24:19 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch)
treef0506b668a013d0063e5fba3dbf4863b466713ba /tests/template_tests/syntax_tests/test_debug.py
parentf68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff)
Refs #33476 -- Reformatted code with Black.
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(
- '&#x27;django&#x27;: &lt;module &#x27;django&#x27; ',
+ "&#x27;django&#x27;: &lt;module &#x27;django&#x27; ",
output,
)
- @setup({'plain': '{% debug %}'})
+ @setup({"plain": "{% debug %}"})
def test_plain(self):
- output = self.engine.render_to_string('plain', {'a': 1})
- self.assertTrue(output.startswith(
- '{&#x27;a&#x27;: 1}'
- '{&#x27;False&#x27;: False, &#x27;None&#x27;: None, '
- '&#x27;True&#x27;: True}\n\n{'
- ))
+ output = self.engine.render_to_string("plain", {"a": 1})
+ self.assertTrue(
+ output.startswith(
+ "{&#x27;a&#x27;: 1}"
+ "{&#x27;False&#x27;: False, &#x27;None&#x27;: None, "
+ "&#x27;True&#x27;: 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(
- '{&#x27;group&#x27;: &lt;Group: 清風&gt;}'
- ))
+ output = self.engine.render_to_string("non_ascii", {"group": group})
+ self.assertTrue(output.startswith("{&#x27;group&#x27;: &lt;Group: 清風&gt;}"))
- @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;}")
+ )