From 739fd1a92e3312529abb8ce06006b32aead0f20d Mon Sep 17 00:00:00 2001 From: hvelarde Date: Thu, 30 Mar 2017 17:27:56 -0300 Subject: [PATCH] Remove image traverses test from basic tile The test makes no sense as it was implemented and is failing with newer versions of Pillow. --- src/collective/cover/tests/test_basic_tile.py | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/src/collective/cover/tests/test_basic_tile.py b/src/collective/cover/tests/test_basic_tile.py index 6d1c55ea5..b045cc690 100644 --- a/src/collective/cover/tests/test_basic_tile.py +++ b/src/collective/cover/tests/test_basic_tile.py @@ -202,36 +202,6 @@ def test_populate_with_file(self): # there is no image... self.assertNotIn('test/@@images', rendered) - def test_image_traverser(self): - # XXX: probably this should be moved to a new test views module - - def images_are_equal(str1, str2): - # XXX: refactor - from PIL import Image - from PIL import ImageChops - from StringIO import StringIO - im1 = StringIO() - im2 = StringIO() - im1.write(str1) - im1.seek(0) - im2.write(str2) - im2.seek(0) - return ImageChops.difference(Image.open(im1), Image.open(im2)).getbbox() is None - - obj = self.portal['my-image'] - self.tile.populate_with_object(obj) - - scales = self.cover.restrictedTraverse( - '@@{0}/{1}/@@images'.format('collective.cover.basic', 'test')) - scale = scales.scale('image') - - try: - image = obj.getImage() # Archetypes - except AttributeError: - image = obj.image.data # Dexterity - - self.assertTrue(images_are_equal(image, scale.data.data)) - def test_basic_tile_image(self): obj = self.portal['my-news-item'] self.tile.populate_with_object(obj)