1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[1.7.x] Fixed #22337: FileSystemStorage marked as deconstructible and tested.

This commit is contained in:
Andrew Godwin
2014-05-06 22:23:23 -07:00
parent a75318e813
commit f53d1576ca
3 changed files with 21 additions and 0 deletions

View File

@@ -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