Commit 3c3c3faa authored by Jérome Perrin's avatar Jérome Perrin

fixup! corporate_identity_test: use PNG files for reference data

parent 69f6a0f1
......@@ -30,6 +30,7 @@ from Products.Localizer.itools.i18n.accept import AcceptLanguage
from PIL import Image
import cStringIO
import math
import os.path
def changeSkin(skin_name):
......@@ -138,10 +139,14 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
rms = self.computeImageRenderingRootMeanSquare(test_image_data, expected_image_data)
if rms <= max_rms:
return
raise AssertionError("%(message)s\nComparing rendered image:\n%(base64_1)s\nWith expected image:\n%(base64_2)s\nRMS: %(rms)s > %(max_rms)s\nAssertionError: %(message)s" % {
from Products.ERP5Type.tests.runUnitTest import log_directory
if log_directory:
with open(os.path.join(log_directory, '%s-expected.png' % self.id()), 'wb') as f:
f.write(expected_image_data)
with open(os.path.join(log_directory, '%s-actual.png' % self.id()), 'wb') as f:
f.write(test_image_data)
raise AssertionError("%(message)s\nRMS: %(rms)s > %(max_rms)s\nAssertionError: %(message)s" % {
"message": message,
"base64_1": test_image_data,
"base64_2": expected_image_data,
"rms": rms,
"max_rms": max_rms,
})
......
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