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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
5707bc61
Commit
5707bc61
authored
Jan 27, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testDeferredStyle py3
parent
dc2bc32c
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 @
5707bc61
...
@@ -133,7 +133,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
...
@@ -133,7 +133,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
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
():
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
content_type
=
part
.
get_content_type
()
file_name
=
part
.
get_filename
()
file_name
=
part
.
get_filename
()
...
@@ -198,7 +198,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
...
@@ -198,7 +198,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
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
():
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
content_type
=
part
.
get_content_type
()
if
content_type
==
"text/html"
:
if
content_type
==
"text/html"
:
...
@@ -236,7 +236,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
...
@@ -236,7 +236,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
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
():
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
content_type
=
part
.
get_content_type
()
if
content_type
==
"text/html"
:
if
content_type
==
"text/html"
:
...
@@ -260,7 +260,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
...
@@ -260,7 +260,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
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
():
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
content_type
=
part
.
get_content_type
()
if
content_type
==
"text/html"
:
if
content_type
==
"text/html"
:
...
@@ -285,7 +285,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
...
@@ -285,7 +285,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
self
.
assertNotEqual
(
last_message
,
())
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
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
():
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
content_type
=
part
.
get_content_type
()
if
content_type
==
self
.
content_type
:
if
content_type
==
self
.
content_type
:
...
@@ -315,7 +315,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
...
@@ -315,7 +315,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
'HTTP_ACCEPT_LANGUAGE'
:
'fr;q=0.9,en;q=0.8'
,
'HTTP_ACCEPT_LANGUAGE'
:
'fr;q=0.9,en;q=0.8'
,
})
})
self
.
tic
()
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
# mail subject is translated
self
.
assertEqual
(
'Historique'
,
mail_message
[
'subject'
])
self
.
assertEqual
(
'Historique'
,
mail_message
[
'subject'
])
# content is translated
# content is translated
...
@@ -345,11 +345,11 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
...
@@ -345,11 +345,11 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
'HTTP_COOKIE'
:
'LOCALIZER_LANGUAGE="fr"'
,
'HTTP_COOKIE'
:
'LOCALIZER_LANGUAGE="fr"'
,
})
})
self
.
tic
()
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
# mail subject is translated
self
.
assertEqual
(
'Historique'
,
mail_message
[
'subject'
])
self
.
assertEqual
(
'Historique'
,
mail_message
[
'subject'
])
# content is translated
# 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
]
part
,
=
[
x
for
x
in
mail_message
.
walk
()
if
x
.
get_content_type
()
==
self
.
content_type
]
self
.
assertIn
(
self
.
assertIn
(
'Historique'
,
'Historique'
,
...
@@ -450,7 +450,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
...
@@ -450,7 +450,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
# inspect the report as text and check the selection was initialized from
# inspect the report as text and check the selection was initialized from
# request parameter.
# 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
]
part
,
=
[
x
for
x
in
mail_message
.
walk
()
if
x
.
get_content_type
()
==
self
.
content_type
]
doc
=
self
.
portal
.
document_module
.
newContent
(
doc
=
self
.
portal
.
document_module
.
newContent
(
...
@@ -487,7 +487,7 @@ class TestODSDeferredStyle(TestDeferredStyleBase):
...
@@ -487,7 +487,7 @@ class TestODSDeferredStyle(TestDeferredStyleBase):
self
.
assertNotEqual
(
last_message
,
())
self
.
assertNotEqual
(
last_message
,
())
mfrom
,
mto
,
message_text
=
last_message
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
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
():
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
content_type
=
part
.
get_content_type
()
file_name
=
part
.
get_filename
()
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