mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.7.x] Fixed #22337: FileSystemStorage marked as deconstructible and tested.
This commit is contained in:
		| @@ -64,6 +64,23 @@ class GetStorageClassTests(SimpleTestCase): | ||||
|                 'django.core.files.non_existing_storage.NonExistingStorage') | ||||
|  | ||||
|  | ||||
| class FileStorageDeconstructionTests(unittest.TestCase): | ||||
|  | ||||
|     def test_deconstruction(self): | ||||
|         path, args, kwargs = temp_storage.deconstruct() | ||||
|         self.assertEqual(path, "django.core.files.storage.FileSystemStorage") | ||||
|         self.assertEqual(args, tuple()) | ||||
|         self.assertEqual(kwargs, {'location': temp_storage_location}) | ||||
|  | ||||
|         kwargs_orig = { | ||||
|             'location': temp_storage_location, | ||||
|             'base_url': 'http://myfiles.example.com/' | ||||
|         } | ||||
|         storage = FileSystemStorage(**kwargs_orig) | ||||
|         path, args, kwargs = storage.deconstruct() | ||||
|         self.assertEqual(kwargs, kwargs_orig) | ||||
|  | ||||
|  | ||||
| class FileStorageTests(unittest.TestCase): | ||||
|     storage_class = FileSystemStorage | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user