summaryrefslogtreecommitdiff
path: root/tests/file_uploads
diff options
context:
space:
mode:
authorMichael Brown <michael@msbrown.net>2020-06-08 12:55:27 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-06-11 08:46:59 +0200
commit36db4dd937ae11c5b687c5d2e5fa3c27e4140001 (patch)
tree9ee9d7e78f1528f75d7b79c935d845122f6dd36f /tests/file_uploads
parent678c8dfee458cda77fce0d1c127f1939dc134584 (diff)
downloaddjango-36db4dd937ae11c5b687c5d2e5fa3c27e4140001.tar.gz
Fixed #28132 -- Made MultiPartParser ignore filenames with trailing slash.
Diffstat (limited to 'tests/file_uploads')
-rw-r--r--tests/file_uploads/tests.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py
index 5743344a51..df8f1b8031 100644
--- a/tests/file_uploads/tests.py
+++ b/tests/file_uploads/tests.py
@@ -209,10 +209,14 @@ class FileUploadTests(TestCase):
Receiving file upload when filename is blank (before and after
sanitization) should be okay.
"""
- # The second value is normalized to an empty name by
- # MultiPartParser.IE_sanitize()
- filenames = ['', 'C:\\Windows\\']
-
+ filenames = [
+ '',
+ # Normalized by MultiPartParser.IE_sanitize().
+ 'C:\\Windows\\',
+ # Normalized by os.path.basename().
+ '/',
+ 'ends-with-slash/',
+ ]
payload = client.FakePayload()
for i, name in enumerate(filenames):
payload.write('\r\n'.join([