summaryrefslogtreecommitdiff
path: root/tests/file_uploads
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/file_uploads
parent9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff)
downloaddjango-7119f40c9881666b6f9b5cf7df09ee1d21cc8344.tar.gz
Refs #33476 -- Refactored code to strictly match 88 characters line length.
Diffstat (limited to 'tests/file_uploads')
-rw-r--r--tests/file_uploads/tests.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py
index 37f9559eef..c96f36e2a1 100644
--- a/tests/file_uploads/tests.py
+++ b/tests/file_uploads/tests.py
@@ -198,8 +198,8 @@ class FileUploadTests(TestCase):
"\r\n".join(
[
"--" + client.BOUNDARY,
- "Content-Disposition: form-data; name=\"file_unicode\"; filename*=UTF-8''%s"
- % quote(UNICODE_FILENAME),
+ 'Content-Disposition: form-data; name="file_unicode"; '
+ "filename*=UTF-8''%s" % quote(UNICODE_FILENAME),
"Content-Type: application/octet-stream",
"",
"You got pwnd.\r\n",
@@ -228,8 +228,8 @@ class FileUploadTests(TestCase):
"\r\n".join(
[
"--" + client.BOUNDARY,
- "Content-Disposition: form-data; name*=UTF-8''file_unicode; filename*=UTF-8''%s"
- % quote(UNICODE_FILENAME),
+ "Content-Disposition: form-data; name*=UTF-8''file_unicode; "
+ "filename*=UTF-8''%s" % quote(UNICODE_FILENAME),
"Content-Type: application/octet-stream",
"",
"You got pwnd.\r\n",
@@ -349,7 +349,8 @@ class FileUploadTests(TestCase):
"\r\n".join(
[
"--" + client.BOUNDARY,
- f'Content-Disposition: form-data; name="file"; filename="{file_name}"',
+ f'Content-Disposition: form-data; name="file"; '
+ f'filename="{file_name}"',
"Content-Type: application/octet-stream",
"",
"You got pwnd.\r\n",
@@ -706,7 +707,8 @@ class FileUploadTests(TestCase):
self.assertNotEqual(
str(err),
str(reference_error),
- "Caught a repeated exception that'll cause an infinite loop in file uploads.",
+ "Caught a repeated exception that'll cause an infinite loop in "
+ "file uploads.",
)
except Exception as err:
# CustomUploadError is the error that should have been raised
@@ -723,7 +725,8 @@ class FileUploadTests(TestCase):
vars = {"boundary": "oUrBoUnDaRyStRiNg"}
post_data = [
"--%(boundary)s",
- 'Content-Disposition: form-data; name="file_field"; filename="MiXeD_cAsE.txt"',
+ 'Content-Disposition: form-data; name="file_field"; '
+ 'filename="MiXeD_cAsE.txt"',
"Content-Type: application/octet-stream",
"",
"file contents\n",
@@ -907,7 +910,8 @@ class MultiParserTests(SimpleTestCase):
def test_rfc2231_parsing(self):
test_data = (
(
- b"Content-Type: application/x-stuff; title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A",
+ b"Content-Type: application/x-stuff; "
+ b"title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A",
"This is ***fun***",
),
(
@@ -930,7 +934,8 @@ class MultiParserTests(SimpleTestCase):
"""
test_data = (
(
- b"Content-Type: application/x-stuff; title*='This%20is%20%2A%2A%2Afun%2A%2A%2A",
+ b"Content-Type: application/x-stuff; "
+ b"title*='This%20is%20%2A%2A%2Afun%2A%2A%2A",
b"'This%20is%20%2A%2A%2Afun%2A%2A%2A",
),
(b"Content-Type: application/x-stuff; title*='foo.html", b"'foo.html"),