mirror of
https://github.com/django/django.git
synced 2025-07-12 13:49:11 +00:00
[2.2.x] Skipped GetImageDimensionsTests.test_webp when WEBP is not installed.
Bumped minimum Pillow version to 4.2.0 in test requirements. Backport of fce389af7cf95151118c9fc7cafd777a31f94946 from master
This commit is contained in:
parent
0f6e73e567
commit
657fea55cb
@ -235,7 +235,7 @@ dependencies:
|
|||||||
* geoip2_
|
* geoip2_
|
||||||
* jinja2_ 2.7+
|
* jinja2_ 2.7+
|
||||||
* numpy_
|
* numpy_
|
||||||
* Pillow_
|
* Pillow_ 4.2.0+
|
||||||
* PyYAML_
|
* PyYAML_
|
||||||
* pytz_ (required)
|
* pytz_ (required)
|
||||||
* pywatchman_
|
* pywatchman_
|
||||||
|
@ -17,9 +17,11 @@ from django.core.files.uploadedfile import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PIL import Image
|
from PIL import Image, features
|
||||||
|
HAS_WEBP = features.check('webp')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
Image = None
|
Image = None
|
||||||
|
HAS_WEBP = False
|
||||||
else:
|
else:
|
||||||
from django.core.files import images
|
from django.core.files import images
|
||||||
|
|
||||||
@ -343,6 +345,7 @@ class GetImageDimensionsTests(unittest.TestCase):
|
|||||||
size = images.get_image_dimensions(fh)
|
size = images.get_image_dimensions(fh)
|
||||||
self.assertEqual(size, (None, None))
|
self.assertEqual(size, (None, None))
|
||||||
|
|
||||||
|
@unittest.skipUnless(HAS_WEBP, 'WEBP not installed')
|
||||||
def test_webp(self):
|
def test_webp(self):
|
||||||
img_path = os.path.join(os.path.dirname(__file__), 'test.webp')
|
img_path = os.path.join(os.path.dirname(__file__), 'test.webp')
|
||||||
with open(img_path, 'rb') as fh:
|
with open(img_path, 'rb') as fh:
|
||||||
|
@ -4,7 +4,7 @@ docutils
|
|||||||
geoip2 < 4.0.0
|
geoip2 < 4.0.0
|
||||||
jinja2 >= 2.9.2
|
jinja2 >= 2.9.2
|
||||||
numpy
|
numpy
|
||||||
Pillow != 5.4.0
|
Pillow >=4.2.0, != 5.4.0
|
||||||
# pylibmc/libmemcached can't be built on Windows.
|
# pylibmc/libmemcached can't be built on Windows.
|
||||||
pylibmc; sys.platform != 'win32'
|
pylibmc; sys.platform != 'win32'
|
||||||
python-memcached >= 1.59
|
python-memcached >= 1.59
|
||||||
|
Loading…
x
Reference in New Issue
Block a user