mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #28224 -- Tested for SuspiciousOperation subclasses in Django's tests.
This commit is contained in:
parent
f8bce94997
commit
67e1afb4a8
3 changed files with 15 additions and 15 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue