mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #27836 -- Fixed cleanup exception in file_storage test.
TemporaryDirectory tries to delete the directory that was already removed.
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						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', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user