mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Do not allow FileSystemStorage.delete to receive an empty name
Refs #20660.
This commit is contained in:
@@ -364,6 +364,14 @@ class FileStorageTests(unittest.TestCase):
|
||||
with self.assertRaises(IOError):
|
||||
self.storage.save('error.file', f1)
|
||||
|
||||
def test_delete_no_name(self):
|
||||
"""
|
||||
Calling delete with an empty name should not try to remove the base
|
||||
storage directory, but fail loudly (#20660).
|
||||
"""
|
||||
with self.assertRaises(AssertionError):
|
||||
self.storage.delete('')
|
||||
|
||||
|
||||
class CustomStorage(FileSystemStorage):
|
||||
def get_available_name(self, name):
|
||||
|
||||
Reference in New Issue
Block a user