diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-08 12:27:04 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-08 19:25:02 +0100 |
| commit | 3278c31fa59b41d03aea167f4cf85f4ddf7f848d (patch) | |
| tree | 0c80b4868391296335580242c8e65052a4f62a6b /tests/staticfiles_tests | |
| parent | 6a682b38e75d4c975b4c4493565a59f1bc14397c (diff) | |
[4.0.x] Refs #33476 -- Refactored code to strictly match 88 characters line length.
Backport of 7119f40c9881666b6f9b5cf7df09ee1d21cc8344 from main.
Diffstat (limited to 'tests/staticfiles_tests')
| -rw-r--r-- | tests/staticfiles_tests/test_checks.py | 5 | ||||
| -rw-r--r-- | tests/staticfiles_tests/test_forms.py | 13 | ||||
| -rw-r--r-- | tests/staticfiles_tests/test_management.py | 12 | ||||
| -rw-r--r-- | tests/staticfiles_tests/test_storage.py | 3 |
4 files changed, 22 insertions, 11 deletions
diff --git a/tests/staticfiles_tests/test_checks.py b/tests/staticfiles_tests/test_checks.py index 5a4cbe7d0f..a8c6b78a96 100644 --- a/tests/staticfiles_tests/test_checks.py +++ b/tests/staticfiles_tests/test_checks.py @@ -16,7 +16,10 @@ class FindersCheckTests(CollectionTestCase): def test_base_finder_check_not_implemented(self): finder = BaseFinder() - msg = "subclasses may provide a check() method to verify the finder is configured correctly." + msg = ( + "subclasses may provide a check() method to verify the finder is " + "configured correctly." + ) with self.assertRaisesMessage(NotImplementedError, msg): finder.check() diff --git a/tests/staticfiles_tests/test_forms.py b/tests/staticfiles_tests/test_forms.py index b0c5c19a0e..16ab904d17 100644 --- a/tests/staticfiles_tests/test_forms.py +++ b/tests/staticfiles_tests/test_forms.py @@ -29,10 +29,11 @@ class StaticFilesFormsMediaTestCase(SimpleTestCase): ) self.assertEqual( str(m), - """<link href="https://example.com/assets/path/to/css1" type="text/css" media="all" rel="stylesheet"> -<link href="/path/to/css2" type="text/css" media="all" rel="stylesheet"> -<script src="/path/to/js1"></script> -<script src="http://media.other.com/path/to/js2"></script> -<script src="https://secure.other.com/path/to/js3"></script> -<script src="https://example.com/assets/relative/path/to/js4"></script>""", + '<link href="https://example.com/assets/path/to/css1" type="text/css" ' + 'media="all" rel="stylesheet">\n' + '<link href="/path/to/css2" type="text/css" media="all" rel="stylesheet">\n' + '<script src="/path/to/js1"></script>\n' + '<script src="http://media.other.com/path/to/js2"></script>\n' + '<script src="https://secure.other.com/path/to/js3"></script>\n' + '<script src="https://example.com/assets/relative/path/to/js4"></script>', ) diff --git a/tests/staticfiles_tests/test_management.py b/tests/staticfiles_tests/test_management.py index afc8cc1637..09ce7c488c 100644 --- a/tests/staticfiles_tests/test_management.py +++ b/tests/staticfiles_tests/test_management.py @@ -142,7 +142,9 @@ class TestConfiguration(StaticFilesTestCase): try: storage.staticfiles_storage._wrapped = empty with self.settings( - STATICFILES_STORAGE="django.contrib.staticfiles.storage.StaticFilesStorage" + STATICFILES_STORAGE=( + "django.contrib.staticfiles.storage.StaticFilesStorage" + ) ): command = collectstatic.Command() self.assertTrue(command.is_local_storage()) @@ -240,7 +242,9 @@ class TestCollectionVerbosity(CollectionTestCase): self.assertIn(self.copying_msg, output) @override_settings( - STATICFILES_STORAGE="django.contrib.staticfiles.storage.ManifestStaticFilesStorage" + STATICFILES_STORAGE=( + "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" + ) ) def test_verbosity_1_with_post_process(self): stdout = StringIO() @@ -248,7 +252,9 @@ class TestCollectionVerbosity(CollectionTestCase): self.assertNotIn(self.post_process_msg, stdout.getvalue()) @override_settings( - STATICFILES_STORAGE="django.contrib.staticfiles.storage.ManifestStaticFilesStorage" + STATICFILES_STORAGE=( + "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" + ) ) def test_verbosity_2_with_post_process(self): stdout = StringIO() diff --git a/tests/staticfiles_tests/test_storage.py b/tests/staticfiles_tests/test_storage.py index e3685671dd..eba91a45a4 100644 --- a/tests/staticfiles_tests/test_storage.py +++ b/tests/staticfiles_tests/test_storage.py @@ -109,7 +109,8 @@ class TestHashedFiles: b"fonts/font.b8d603e42714.svg#path/to/../../fonts/font.svg", content ) self.assertIn( - b"data:font/woff;charset=utf-8;base64,d09GRgABAAAAADJoAA0AAAAAR2QAAQAAAAAAAAAAAAA", + b"data:font/woff;charset=utf-8;" + b"base64,d09GRgABAAAAADJoAA0AAAAAR2QAAQAAAAAAAAAAAAA", content, ) self.assertIn(b"#default#VML", content) |
