diff options
Diffstat (limited to 'tests/check_framework')
| -rw-r--r-- | tests/check_framework/test_model_field_deprecation.py | 5 | ||||
| -rw-r--r-- | tests/check_framework/test_security.py | 4 | ||||
| -rw-r--r-- | tests/check_framework/test_translation.py | 5 | ||||
| -rw-r--r-- | tests/check_framework/test_urls.py | 18 |
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 d73e9075e8..30c4135373 100644 --- a/tests/check_framework/test_security.py +++ b/tests/check_framework/test_security.py @@ -502,7 +502,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.", ] |
