summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-03 11:20:46 +0100
committerGitHub <noreply@github.com>2022-02-03 11:20:46 +0100
commitc5cd8783825b5f6384417dac5f3889b4210b7d08 (patch)
tree3d4689aaa0e209e40d2d8df09edad7e155960b45 /tests/template_tests
parentc9d6e3595cfd0aa58cde1656bd735ecfcd7a872b (diff)
Refs #33476 -- Refactored problematic code before reformatting by Black.
In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/filter_tests/test_urlizetrunc.py7
-rw-r--r--tests/template_tests/syntax_tests/i18n/test_get_language_info.py2
-rw-r--r--tests/template_tests/test_custom.py3
3 files changed, 5 insertions, 7 deletions
diff --git a/tests/template_tests/filter_tests/test_urlizetrunc.py b/tests/template_tests/filter_tests/test_urlizetrunc.py
index e37e277212..09bbe776cf 100644
--- a/tests/template_tests/filter_tests/test_urlizetrunc.py
+++ b/tests/template_tests/filter_tests/test_urlizetrunc.py
@@ -60,14 +60,13 @@ class FunctionTests(SimpleTestCase):
self.assertEqual(
urlizetrunc(uri, 1),
- '<a href="http://31characteruri.com/test/"'
- ' rel="nofollow">…</a>',
+ '<a href="http://31characteruri.com/test/" rel="nofollow">…</a>',
)
def test_overtruncate(self):
self.assertEqual(
- urlizetrunc('http://short.com/', 20), '<a href='
- '"http://short.com/" rel="nofollow">http://short.com/</a>',
+ urlizetrunc('http://short.com/', 20),
+ '<a href="http://short.com/" rel="nofollow">http://short.com/</a>',
)
def test_query_string(self):
diff --git a/tests/template_tests/syntax_tests/i18n/test_get_language_info.py b/tests/template_tests/syntax_tests/i18n/test_get_language_info.py
index 51e8d2bc79..4ae8186af5 100644
--- a/tests/template_tests/syntax_tests/i18n/test_get_language_info.py
+++ b/tests/template_tests/syntax_tests/i18n/test_get_language_info.py
@@ -36,7 +36,7 @@ class I18nGetLanguageInfoTagTests(SimpleTestCase):
output = self.engine.render_to_string('i18n38')
self.assertEqual(output, 'de: German/Deutsch/německy bidi=False')
- @setup({'template': '{% load i18n %}''{% get_language_info %}'})
+ @setup({'template': '{% load i18n %}{% get_language_info %}'})
def test_no_for_as(self):
msg = "'get_language_info' requires 'for string as variable' (got [])"
with self.assertRaisesMessage(TemplateSyntaxError, msg):
diff --git a/tests/template_tests/test_custom.py b/tests/template_tests/test_custom.py
index cade3e4610..59f83d80e2 100644
--- a/tests/template_tests/test_custom.py
+++ b/tests/template_tests/test_custom.py
@@ -104,8 +104,7 @@ class SimpleTagTests(TagTestCase):
(
"'simple_keyword_only_param' received multiple values for "
"keyword argument 'kwarg'",
- '{% load custom %}{% simple_keyword_only_param kwarg=42 '
- 'kwarg=37 %}',
+ '{% load custom %}{% simple_keyword_only_param kwarg=42 kwarg=37 %}',
),
(
"'simple_keyword_only_default' received multiple values for "