summaryrefslogtreecommitdiff
path: root/tests/file_storage
diff options
context:
space:
mode:
authorchillaranand <anand21nanda@gmail.com>2017-02-22 20:14:25 +0530
committerTim Graham <timograham@gmail.com>2017-02-24 16:02:33 -0500
commite4025563ea87b0e3acb1d617ebfcc0b8789f75e7 (patch)
treef7608d1ff7677cf1deb0083675bba4bfa1d7797e /tests/file_storage
parent339d526d55baffea3bd3cecd0e07ddf644028e8c (diff)
downloaddjango-e4025563ea87b0e3acb1d617ebfcc0b8789f75e7.tar.gz
Fixed #27836 -- Allowed FileSystemStorage.delete() to remove directories.
Diffstat (limited to 'tests/file_storage')
-rw-r--r--tests/file_storage/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py
index 494832badd..b6a6f8c2f1 100644
--- a/tests/file_storage/tests.py
+++ b/tests/file_storage/tests.py
@@ -495,6 +495,11 @@ class FileStorageTests(SimpleTestCase):
with self.assertRaises(AssertionError):
self.storage.delete('')
+ def test_delete_deletes_directories(self):
+ tmp_dir = tempfile.TemporaryDirectory(dir=self.storage.location)
+ self.storage.delete(tmp_dir.name)
+ self.assertFalse(os.path.exists(tmp_dir.name))
+
@override_settings(
MEDIA_ROOT='media_root',
MEDIA_URL='media_url/',