Skip to content

Commit

Permalink
Refs #28184 -- Added test for FileField storage default.
Browse files Browse the repository at this point in the history
Co-authored-by: miigotu <miigotu@gmail.com>
  • Loading branch information
carltongibson and miigotu committed Apr 8, 2020
1 parent 210657b commit 94b32a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/file_storage/tests.py
Expand Up @@ -14,7 +14,8 @@
from django.core.exceptions import SuspiciousFileOperation
from django.core.files.base import ContentFile, File
from django.core.files.storage import (
FileSystemStorage, Storage as BaseStorage, get_storage_class,
FileSystemStorage, Storage as BaseStorage, default_storage,
get_storage_class,
)
from django.core.files.uploadedfile import (
InMemoryUploadedFile, SimpleUploadedFile, TemporaryUploadedFile,
Expand Down Expand Up @@ -885,6 +886,9 @@ class NotStorage:
with self.assertRaisesMessage(TypeError, msg):
FileField(storage=invalid_type)

def test_file_field_storage_none_uses_default_storage(self):
self.assertEqual(FileField().storage, default_storage)

def test_callable_function_storage_file_field(self):
storage = FileSystemStorage(location=self.temp_storage_location)

Expand Down

0 comments on commit 94b32a2

Please sign in to comment.