Refs -- Fixed cleanup exception in file_storage test.
TemporaryDirectory tries to delete the directory that was already removed.
@@ -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',
