Commit 39b512da authored by Jérome Perrin's avatar Jérome Perrin

corporate_identity_test: update test for python3 compatibility

parent b0f89c49
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.Localizer.itools.i18n.accept import AcceptLanguage from Products.Localizer.itools.i18n.accept import AcceptLanguage
from PIL import Image from PIL import Image
import cStringIO import io
import math import math
import os.path import os.path
from lxml.html import fromstring, tostring from lxml.html import fromstring, tostring
...@@ -120,8 +120,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -120,8 +120,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
# http://snipplr.com/view/757/compare-two-pil-images-in-python/ # http://snipplr.com/view/757/compare-two-pil-images-in-python/
# http://effbot.org/zone/pil-comparing-images.htm # http://effbot.org/zone/pil-comparing-images.htm
# http://effbot.org/imagingbook/image.htm # http://effbot.org/imagingbook/image.htm
image1 = Image.open(cStringIO.StringIO(image_data_1)) image1 = Image.open(io.BytesIO(image_data_1))
image2 = Image.open(cStringIO.StringIO(image_data_2)) image2 = Image.open(io.BytesIO(image_data_2))
# image can be converted into greyscale without transparency # image can be converted into greyscale without transparency
h1 = image1.histogram() h1 = image1.histogram()
...@@ -259,7 +259,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -259,7 +259,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
if dump: if dump:
expected_image.setData(png) expected_image.setData(png)
self.tic() self.tic()
self.assertImageRenderingEquals(str(png), str(expected_image.getData())) self.assertImageRenderingEquals(bytes(png), bytes(expected_image.getData()))
############################################################################## ##############################################################################
# What rendering is tested: # What rendering is tested:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment