diff options
author | Rajesh Veeranki <rveeranki01@gmail.com> | 2017-05-25 19:19:01 +0700 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-05-25 08:19:01 -0400 |
commit | 67e1afb4a8478af6725e45a9fdcd2a511b2eb005 (patch) | |
tree | 3a306f9d8643e66b878a9a1187a5824af94c9daa /tests/file_storage | |
parent | f8bce94997739e4e61919cddff84fc3e3302d8f7 (diff) | |
download | django-67e1afb4a8478af6725e45a9fdcd2a511b2eb005.tar.gz |
Fixed #28224 -- Tested for SuspiciousOperation subclasses in Django's tests.
Diffstat (limited to 'tests/file_storage')
-rw-r--r-- | tests/file_storage/tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index 3413829ced..1ac86f6751 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -10,7 +10,7 @@ from io import StringIO from urllib.request import urlopen from django.core.cache import cache -from django.core.exceptions import SuspiciousFileOperation, SuspiciousOperation +from django.core.exceptions import SuspiciousFileOperation from django.core.files.base import ContentFile, File from django.core.files.storage import FileSystemStorage, get_storage_class from django.core.files.uploadedfile import ( @@ -384,9 +384,9 @@ class FileStorageTests(SimpleTestCase): File storage prevents directory traversal (files can only be accessed if they're below the storage location). """ - with self.assertRaises(SuspiciousOperation): + with self.assertRaises(SuspiciousFileOperation): self.storage.exists('..') - with self.assertRaises(SuspiciousOperation): + with self.assertRaises(SuspiciousFileOperation): self.storage.exists('/etc/passwd') def test_file_storage_preserves_filename_case(self): |