diff options
author | chillaranand <anand21nanda@gmail.com> | 2017-02-22 20:14:25 +0530 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-02-24 16:02:33 -0500 |
commit | e4025563ea87b0e3acb1d617ebfcc0b8789f75e7 (patch) | |
tree | f7608d1ff7677cf1deb0083675bba4bfa1d7797e /tests/file_storage | |
parent | 339d526d55baffea3bd3cecd0e07ddf644028e8c (diff) | |
download | django-e4025563ea87b0e3acb1d617ebfcc0b8789f75e7.tar.gz |
Fixed #27836 -- Allowed FileSystemStorage.delete() to remove directories.
Diffstat (limited to 'tests/file_storage')
-rw-r--r-- | tests/file_storage/tests.py | 5 |
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/', |