summaryrefslogtreecommitdiff
path: root/tests/check_framework
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-04 08:08:27 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit7119f40c9881666b6f9b5cf7df09ee1d21cc8344 (patch)
treefa50869f5614295f462d9bf77fec59365c621609 /tests/check_framework
parent9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff)
Refs #33476 -- Refactored code to strictly match 88 characters line length.
Diffstat (limited to 'tests/check_framework')
-rw-r--r--tests/check_framework/test_model_field_deprecation.py5
-rw-r--r--tests/check_framework/test_security.py4
-rw-r--r--tests/check_framework/test_translation.py5
-rw-r--r--tests/check_framework/test_urls.py18
4 files changed, 21 insertions, 11 deletions
diff --git a/tests/check_framework/test_model_field_deprecation.py b/tests/check_framework/test_model_field_deprecation.py
index 668553c04e..50cca0ed8a 100644
--- a/tests/check_framework/test_model_field_deprecation.py
+++ b/tests/check_framework/test_model_field_deprecation.py
@@ -64,7 +64,10 @@ class TestRemovedField(SimpleTestCase):
model.check(),
[
checks.Error(
- msg="MyField has been removed except for support in historical migrations.",
+ msg=(
+ "MyField has been removed except for support in historical "
+ "migrations."
+ ),
obj=Model._meta.get_field("name"),
id="fields.EXXX",
)
diff --git a/tests/check_framework/test_security.py b/tests/check_framework/test_security.py
index 413e2da1fa..d025c4d92c 100644
--- a/tests/check_framework/test_security.py
+++ b/tests/check_framework/test_security.py
@@ -597,7 +597,9 @@ class CSRFFailureViewTest(SimpleTestCase):
)
@override_settings(
- CSRF_FAILURE_VIEW="check_framework.test_security.failure_view_with_invalid_signature",
+ CSRF_FAILURE_VIEW=(
+ "check_framework.test_security.failure_view_with_invalid_signature"
+ ),
)
def test_failure_view_invalid_signature(self):
msg = (
diff --git a/tests/check_framework/test_translation.py b/tests/check_framework/test_translation.py
index b20ed90860..cba38af2ff 100644
--- a/tests/check_framework/test_translation.py
+++ b/tests/check_framework/test_translation.py
@@ -75,7 +75,10 @@ class TranslationCheckTests(SimpleTestCase):
self.assertEqual(check_setting_languages_bidi(None), [])
def test_invalid_languages_bidi(self):
- msg = "You have provided an invalid language code in the LANGUAGES_BIDI setting: %r."
+ msg = (
+ "You have provided an invalid language code in the LANGUAGES_BIDI setting: "
+ "%r."
+ )
for tag in self.invalid_tags:
with self.subTest(tag), self.settings(LANGUAGES_BIDI=[tag]):
self.assertEqual(
diff --git a/tests/check_framework/test_urls.py b/tests/check_framework/test_urls.py
index 6315f8834d..a9038c6f13 100644
--- a/tests/check_framework/test_urls.py
+++ b/tests/check_framework/test_urls.py
@@ -52,9 +52,9 @@ class CheckUrlConfigTests(SimpleTestCase):
self.assertRegex(
warning.msg,
(
- r"^Your URL pattern \('\^tuple/\$', <function <lambda> at 0x(\w+)>\) is "
- r"invalid. Ensure that urlpatterns is a list of path\(\) and/or re_path\(\) "
- r"instances\.$"
+ r"^Your URL pattern \('\^tuple/\$', <function <lambda> at 0x(\w+)>\) "
+ r"is invalid. Ensure that urlpatterns is a list of path\(\) and/or "
+ r"re_path\(\) instances\.$"
),
)
@@ -66,9 +66,9 @@ class CheckUrlConfigTests(SimpleTestCase):
self.assertRegex(
warning.msg,
(
- r"^Your URL pattern \('\^tuple/\$', <function <lambda> at 0x(\w+)>\) is "
- r"invalid. Ensure that urlpatterns is a list of path\(\) and/or re_path\(\) "
- r"instances\.$"
+ r"^Your URL pattern \('\^tuple/\$', <function <lambda> at 0x(\w+)>\) "
+ r"is invalid. Ensure that urlpatterns is a list of path\(\) and/or "
+ r"re_path\(\) instances\.$"
),
)
@@ -211,7 +211,8 @@ class CheckCustomErrorHandlersTests(SimpleTestCase):
Error(
"The custom handler{} view 'check_framework.urls."
"bad_function_based_error_handlers.bad_handler' "
- "does not take the correct number of arguments (request{}).".format(
+ "does not take the correct number of arguments "
+ "(request{}).".format(
code, ", exception" if num_params == 2 else ""
),
id="urls.E007",
@@ -254,7 +255,8 @@ class CheckCustomErrorHandlersTests(SimpleTestCase):
]
hints = [
"Could not import '{}'. View does not exist in module django.views.",
- "Could not import '{}'. Parent module django.invalid_module does not exist.",
+ "Could not import '{}'. Parent module django.invalid_module does not "
+ "exist.",
"No module named 'invalid_module'",
"Could not import '{}'. The path must be fully qualified.",
]