From a57596e443ecb67140e1a9fc0f0e87446b2d0174 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 15 Aug 2024 07:49:20 +0200 Subject: [PATCH] Refs #35658 -- Fixed test_create_file_field_from_another_file_field_in_memory_storage when run in reverse. --- tests/file_storage/tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index b486578cdb..bac88235b5 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -771,7 +771,8 @@ class DiscardingFalseContentStorageTests(FileStorageTests): class FileFieldStorageTests(TestCase): def tearDown(self): - shutil.rmtree(temp_storage_location) + if os.path.exists(temp_storage_location): + shutil.rmtree(temp_storage_location) def _storage_max_filename_length(self, storage): """