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
8ae64daa
Commit
8ae64daa
authored
Jan 27, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testDeferredStyle py3
parent
0c0500de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
product/ERP5OOo/tests/testDeferredStyle.py
product/ERP5OOo/tests/testDeferredStyle.py
+10
-10
No files found.
product/ERP5OOo/tests/testDeferredStyle.py
View file @
8ae64daa
...
...
@@ -133,7 +133,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
.
decode
()
)
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
file_name
=
part
.
get_filename
()
...
...
@@ -198,7 +198,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
.
decode
()
)
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
if
content_type
==
"text/html"
:
...
...
@@ -236,7 +236,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
.
decode
()
)
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
if
content_type
==
"text/html"
:
...
...
@@ -260,7 +260,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
.
decode
()
)
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
if
content_type
==
"text/html"
:
...
...
@@ -285,7 +285,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
.
decode
()
)
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
if
content_type
==
self
.
content_type
:
...
...
@@ -315,7 +315,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
'HTTP_ACCEPT_LANGUAGE'
:
'fr;q=0.9,en;q=0.8'
,
})
self
.
tic
()
mail_message
=
email
.
message_from_string
(
self
.
portal
.
MailHost
.
_last_message
[
2
])
mail_message
=
email
.
message_from_string
(
self
.
portal
.
MailHost
.
_last_message
[
2
]
.
decode
()
)
# mail subject is translated
self
.
assertEqual
(
'Historique'
,
mail_message
[
'subject'
])
# content is translated
...
...
@@ -345,11 +345,11 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
'HTTP_COOKIE'
:
'LOCALIZER_LANGUAGE="fr"'
,
})
self
.
tic
()
mail_message
=
email
.
message_from_string
(
self
.
portal
.
MailHost
.
_last_message
[
2
])
mail_message
=
email
.
message_from_string
(
self
.
portal
.
MailHost
.
_last_message
[
2
]
.
decode
()
)
# mail subject is translated
self
.
assertEqual
(
'Historique'
,
mail_message
[
'subject'
])
# content is translated
mail_message
=
email
.
message_from_string
(
self
.
portal
.
MailHost
.
_last_message
[
2
])
mail_message
=
email
.
message_from_string
(
self
.
portal
.
MailHost
.
_last_message
[
2
]
.
decode
()
)
part
,
=
[
x
for
x
in
mail_message
.
walk
()
if
x
.
get_content_type
()
==
self
.
content_type
]
self
.
assertIn
(
'Historique'
,
...
...
@@ -450,7 +450,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
# inspect the report as text and check the selection was initialized from
# request parameter.
mail_message
=
email
.
message_from_string
(
self
.
portal
.
MailHost
.
_last_message
[
2
])
mail_message
=
email
.
message_from_string
(
self
.
portal
.
MailHost
.
_last_message
[
2
]
.
decode
()
)
part
,
=
[
x
for
x
in
mail_message
.
walk
()
if
x
.
get_content_type
()
==
self
.
content_type
]
doc
=
self
.
portal
.
document_module
.
newContent
(
...
...
@@ -487,7 +487,7 @@ class TestODSDeferredStyle(TestDeferredStyleBase):
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
.
decode
()
)
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
file_name
=
part
.
get_filename
()
...
...
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