sorl-thumbnail unit tests fail by 1 pixel (!)
Posted
by stevejalim
on Stack Overflow
See other posts from Stack Overflow
or by stevejalim
Published on 2010-05-13T14:32:28Z
Indexed on
2010/05/13
14:34 UTC
Read the original article
Hit count: 393
Hi
I'm using sorl-thumbnail in a Django 1.2 (currently 1.2 RC) project and getting a surprising failure of four of sorl's built-in unit tests. Essentially, the resized images are all 1px shorter than the unit tests expect them to be. See below for details
I'm developing on OSX 10.5.8 (not Snow Leopard) with Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) and PIL 1.1.6.
Any thoughts what might be up?
Cheers Steve
======================================================================
FAIL: test_extension (sorl.thumbnail.tests.fields.FieldTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/fields.py", line 66, in test_extension
self.verify_thumbnail((50, 37), thumb, expected_filename)
File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/base.py", line 92, in verify_thumbnail
self.assertEqual(image.size, expected_size)
AssertionError: (50, 38) != (50, 37)
======================================================================
FAIL: test_thumbnail (sorl.thumbnail.tests.fields.ImageWithThumbnailsFieldTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/fields.py", line 111, in test_thumbnail
self.verify_thumbnail((50, 37), thumb, expected_filename)
File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/base.py", line 92, in verify_thumbnail
self.assertEqual(image.size, expected_size)
AssertionError: (50, 38) != (50, 37)
======================================================================
FAIL: testTag (sorl.thumbnail.tests.templatetags.ThumbnailTagTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/templatetags.py", line 118, in testTag
self.verify_thumbnail((90, 67), expected_filename=expected_fn)
File "/usr/local/django/myprojectnamehere/lib/sorl/thumbnail/tests/base.py", line 92, in verify_thumbnail
self.assertEqual(image.size, expected_size)
AssertionError: (90, 68) != (90, 67)
© Stack Overflow or respective owner