Refs #27836 -- Fixed cleanup exception in file_storage test.
TemporaryDirectory tries to delete the directory that was already removed.
This commit is contained in:
parent
c1d652c62f
commit
9cbf48693d
|
@ -496,9 +496,9 @@ class FileStorageTests(SimpleTestCase):
|
|||
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))
|
||||
tmp_dir = tempfile.mkdtemp(dir=self.storage.location)
|
||||
self.storage.delete(tmp_dir)
|
||||
self.assertFalse(os.path.exists(tmp_dir))
|
||||
|
||||
@override_settings(
|
||||
MEDIA_ROOT='media_root',
|
||||
|
|
Loading…
Reference in New Issue