summaryrefslogtreecommitdiff
path: root/tests/model_forms/models.py
diff options
context:
space:
mode:
authorManatsawin Hanmongkolchai <manatsawin+git@gmail.com>2017-05-28 14:05:21 +0700
committerTim Graham <timograham@gmail.com>2017-06-01 10:44:47 -0400
commit110bd820380e06fc8572f94b36bba6fc9d057a6b (patch)
treef76f09265ce2a5883826ad7e4c1719849c74451c /tests/model_forms/models.py
parentaf9a81aa7f14ae1a9fd1f25676f526a43f0c65f3 (diff)
[1.11.x] Fixed #28242 -- Moved ImageField file extension validation to the form field.
Backport of a0c07d77fc313388c72a17cd59411265069f037f from master
Diffstat (limited to 'tests/model_forms/models.py')
-rw-r--r--tests/model_forms/models.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py
index f873cfea97..42224ac63e 100644
--- a/tests/model_forms/models.py
+++ b/tests/model_forms/models.py
@@ -214,6 +214,17 @@ try:
def __str__(self):
return self.description
+
+ class NoExtensionImageFile(models.Model):
+ def upload_to(self, filename):
+ return 'tests/no_extension'
+
+ description = models.CharField(max_length=20)
+ image = models.ImageField(storage=temp_storage, upload_to=upload_to)
+
+ def __str__(self):
+ return self.description
+
except ImportError:
test_images = False