summaryrefslogtreecommitdiff
path: root/tests/files
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/files
parent6d1ae5e27c3fe612209023bacd8a201fffedc375 (diff)
downloaddjango-4965a774074780f3e4858bcc975476f71edf2c2c.tar.gz
Removed PIL compatability layer per deprecation timeline.
refs #19934.
Diffstat (limited to 'tests/files')
-rw-r--r--tests/files/tests.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/files/tests.py b/tests/files/tests.py
index b9f8b5228a..4f5e171712 100644
--- a/tests/files/tests.py
+++ b/tests/files/tests.py
@@ -8,7 +8,6 @@ import tempfile
import unittest
import zlib
-from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from django.core.files.move import file_move_safe
from django.core.files.base import ContentFile
@@ -18,10 +17,11 @@ from django.utils._os import upath
from django.utils import six
try:
- from django.utils.image import Image
- from django.core.files import images
-except ImproperlyConfigured:
+ from PIL import Image
+except ImportError:
Image = None
+else:
+ from django.core.files import images
class FileTests(unittest.TestCase):
@@ -112,7 +112,7 @@ class DimensionClosingBug(unittest.TestCase):
"""
Test that get_image_dimensions() properly closes files (#8817)
"""
- @unittest.skipUnless(Image, "Pillow/PIL not installed")
+ @unittest.skipUnless(Image, "Pillow not installed")
def test_not_closing_of_files(self):
"""
Open files passed into get_image_dimensions() should stay opened.
@@ -123,7 +123,7 @@ class DimensionClosingBug(unittest.TestCase):
finally:
self.assertTrue(not empty_io.closed)
- @unittest.skipUnless(Image, "Pillow/PIL not installed")
+ @unittest.skipUnless(Image, "Pillow not installed")
def test_closing_of_filenames(self):
"""
get_image_dimensions() called with a filename should closed the file.
@@ -163,7 +163,7 @@ class InconsistentGetImageDimensionsBug(unittest.TestCase):
Test that get_image_dimensions() works properly after various calls
using a file handler (#11158)
"""
- @unittest.skipUnless(Image, "Pillow/PIL not installed")
+ @unittest.skipUnless(Image, "Pillow not installed")
def test_multiple_calls(self):
"""
Multiple calls of get_image_dimensions() should return the same size.
@@ -177,7 +177,7 @@ class InconsistentGetImageDimensionsBug(unittest.TestCase):
self.assertEqual(image_pil.size, size_1)
self.assertEqual(size_1, size_2)
- @unittest.skipUnless(Image, "Pillow/PIL not installed")
+ @unittest.skipUnless(Image, "Pillow not installed")
def test_bug_19457(self):
"""
Regression test for #19457