mirror of
https://github.com/django/django.git
synced 2025-08-18 17:50:58 +00:00
Fixed #10347 -- Fixed incorrect AttributeError raised when attempting to access a FileField without an instance. Thanks for the report and patch dc.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9902 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
7d03ca9e86
commit
5f9ac28856
2 changed files with 7 additions and 1 deletions
|
@ -35,6 +35,12 @@ class Storage(models.Model):
|
|||
default = models.FileField(storage=temp_storage, upload_to='tests', default='tests/default.txt')
|
||||
|
||||
__test__ = {'API_TESTS':"""
|
||||
# Attempting to access a FileField from the class raises a descriptive error
|
||||
>>> Storage.normal
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AttributeError: The 'normal' attribute can only be accessed from Storage instances.
|
||||
|
||||
# An object without a file has limited functionality.
|
||||
|
||||
>>> obj1 = Storage()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue