Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
3c3c3faa
Commit
3c3c3faa
authored
Mar 30, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! corporate_identity_test: use PNG files for reference data
parent
69f6a0f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
bt5/erp5_corporate_identity_test/TestTemplateItem/portal_components/test.erp5.testCorporateIdentityTemplateList.py
...components/test.erp5.testCorporateIdentityTemplateList.py
+8
-3
No files found.
bt5/erp5_corporate_identity_test/TestTemplateItem/portal_components/test.erp5.testCorporateIdentityTemplateList.py
View file @
3c3c3faa
...
...
@@ -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
\
n
Comparing rendered image:
\
n
%(base64_1)s
\
n
With expected image:
\
n
%(base64_2)s
\
n
RMS: %(rms)s > %(max_rms)s
\
n
AssertionError: %(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
\
n
RMS: %(rms)s > %(max_rms)s
\
n
AssertionError: %(message)s"
%
{
"message"
:
message
,
"base64_1"
:
test_image_data
,
"base64_2"
:
expected_image_data
,
"rms"
:
rms
,
"max_rms"
:
max_rms
,
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment