diff options
| author | Tim Graham <timograham@gmail.com> | 2017-03-17 07:55:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-17 07:55:00 -0400 |
| commit | b536dcf6568ceb4d8aad22cd4e1d38c850980fb4 (patch) | |
| tree | e6a629849830d436fc2d1cccd8a2387ef43f1b09 /tests/view_tests | |
| parent | 6b4f018b2b3478d2a4a441ed52d43f6268ac89f3 (diff) | |
Fixed #27948 -- Removed incorrect unquote() in static serving views.
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/media/%2F.txt | 1 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_static.py | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/view_tests/media/%2F.txt b/tests/view_tests/media/%2F.txt new file mode 100644 index 0000000000..d98b646c7c --- /dev/null +++ b/tests/view_tests/media/%2F.txt @@ -0,0 +1 @@ +%2F content diff --git a/tests/view_tests/tests/test_static.py b/tests/view_tests/tests/test_static.py index f7e5604d06..39ddc6b878 100644 --- a/tests/view_tests/tests/test_static.py +++ b/tests/view_tests/tests/test_static.py @@ -1,6 +1,7 @@ import mimetypes import unittest from os import path +from urllib.parse import quote from django.conf.urls.static import static from django.core.exceptions import ImproperlyConfigured @@ -21,9 +22,9 @@ class StaticTests(SimpleTestCase): def test_serve(self): "The static view can serve static media" - media_files = ['file.txt', 'file.txt.gz'] + media_files = ['file.txt', 'file.txt.gz', '%2F.txt'] for filename in media_files: - response = self.client.get('/%s/%s' % (self.prefix, filename)) + response = self.client.get('/%s/%s' % (self.prefix, quote(filename))) response_content = b''.join(response) file_path = path.join(media_dir, filename) with open(file_path, 'rb') as fp: |
