summaryrefslogtreecommitdiff
path: root/tests/model_fields
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_fields
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_fields')
-rw-r--r--tests/model_fields/test_imagefield.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/model_fields/test_imagefield.py b/tests/model_fields/test_imagefield.py
index e178760d2f..2d636f9610 100644
--- a/tests/model_fields/test_imagefield.py
+++ b/tests/model_fields/test_imagefield.py
@@ -4,7 +4,7 @@ import os
import shutil
from unittest import skipIf
-from django.core.exceptions import ImproperlyConfigured, ValidationError
+from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from django.core.files.images import ImageFile
from django.test import TestCase
@@ -133,12 +133,6 @@ class ImageFieldTests(ImageFieldTestMixin, TestCase):
self.assertEqual(hash(p1_db.mugshot), hash(p1.mugshot))
self.assertIs(p1_db.mugshot != p1.mugshot, False)
- def test_validation(self):
- p = self.PersonModel(name="Joan")
- p.mugshot.save("shot.txt", self.file1)
- with self.assertRaisesMessage(ValidationError, "File extension 'txt' is not allowed."):
- p.full_clean()
-
def test_instantiate_missing(self):
"""
If the underlying file is unavailable, still create instantiate the