summaryrefslogtreecommitdiff
path: root/tests/model_forms
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-03-21 10:54:53 -0400
committerTim Graham <timograham@gmail.com>2014-03-21 10:54:53 -0400
commit4965a774074780f3e4858bcc975476f71edf2c2c (patch)
tree938b3f520bf53384ca644c4e85cf737a9a466771 /tests/model_forms
parent6d1ae5e27c3fe612209023bacd8a201fffedc375 (diff)
Removed PIL compatability layer per deprecation timeline.
refs #19934.
Diffstat (limited to 'tests/model_forms')
-rw-r--r--tests/model_forms/models.py6
-rw-r--r--tests/model_forms/tests.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py
index 59b18dc39d..28feaa97cc 100644
--- a/tests/model_forms/models.py
+++ b/tests/model_forms/models.py
@@ -13,7 +13,7 @@ import os
import tempfile
from django.core import validators
-from django.core.exceptions import ImproperlyConfigured, ValidationError
+from django.core.exceptions import ValidationError
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils import six
@@ -154,7 +154,7 @@ class FilePathModel(models.Model):
try:
- from django.utils.image import Image # NOQA: detect if Pillow is installed
+ from PIL import Image # NOQA: detect if Pillow is installed
test_images = True
@@ -193,7 +193,7 @@ try:
def __str__(self):
return self.description
-except ImproperlyConfigured:
+except ImportError:
test_images = False
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 468f83686e..4504ecb91d 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -1852,7 +1852,7 @@ class FileAndImageFieldTests(TestCase):
names.sort()
self.assertEqual(names, ['---------', '__init__.py', 'models.py', 'tests.py'])
- @skipUnless(test_images, "Pillow/PIL not installed")
+ @skipUnless(test_images, "Pillow not installed")
def test_image_field(self):
# ImageField and FileField are nearly identical, but they differ slighty when
# it comes to validation. This specifically tests that #6302 is fixed for