summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-10-01 13:00:44 -0400
committerTim Graham <timograham@gmail.com>2015-10-01 15:19:39 -0400
commit9f6b704769ba5bc0daafc25340d3dc28b18d8fb1 (patch)
treee94332f2694035bead1b1d545552613a88ae92c3 /tests
parent8a5a002f2f94eec2a6d01e3004c3e6a2ddccd432 (diff)
Fixed #21042 -- Allowed accessing FileDescriptor on the model class.
This is consistent with ability to reference other descriptors on the model class (5ef0c03ae9aca99289737ba6d88a371ad95cf432).
Diffstat (limited to 'tests')
-rw-r--r--tests/file_storage/tests.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py
index 8ff3959427..6b02073bbf 100644
--- a/tests/file_storage/tests.py
+++ b/tests/file_storage/tests.py
@@ -18,6 +18,7 @@ from django.core.files.storage import FileSystemStorage, get_storage_class
from django.core.files.uploadedfile import (
InMemoryUploadedFile, SimpleUploadedFile, TemporaryUploadedFile,
)
+from django.db.models.fields.files import FileDescriptor
from django.test import (
LiveServerTestCase, SimpleTestCase, TestCase, override_settings,
)
@@ -447,9 +448,7 @@ class FileFieldStorageTests(TestCase):
return 255 # Should be safe on most backends
def test_files(self):
- # Attempting to access a FileField from the class raises a descriptive
- # error
- self.assertRaises(AttributeError, lambda: Storage.normal)
+ self.assertIsInstance(Storage.normal, FileDescriptor)
# An object without a file has limited functionality.
obj1 = Storage()