mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #33476 -- Reformatted code with Black.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f68fa8b45d
commit
9c19aff7c7
@@ -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(
|
||||
'{'frag': '<script>'}'
|
||||
))
|
||||
output = self.engine.render_to_string("script", {"frag": "<script>"})
|
||||
self.assertTrue(
|
||||
output.startswith("{'frag': '<script>'}")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user