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
Mikolaï Krol
erp5
Commits
c57780ce
Commit
c57780ce
authored
Nov 15, 2018
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
download the report from the email link and check it
parent
fbc2d816
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
product/ERP5OOo/tests/testDeferredStyle.py
product/ERP5OOo/tests/testDeferredStyle.py
+9
-3
No files found.
product/ERP5OOo/tests/testDeferredStyle.py
View file @
c57780ce
...
...
@@ -32,7 +32,8 @@ from Products.ERP5Type.tests.utils import createZODBPythonScript
from
Testing
import
ZopeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5OOo.tests.utils
import
Validator
import
email
from
lxml
import
html
import
email
,
urlparse
,
httplib
class
TestDeferredStyle
(
ERP5TypeTestCase
,
ZopeTestCase
.
Functional
):
...
...
@@ -235,9 +236,14 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
content_type
=
part
.
get_content_type
()
if
content_type
==
"text/html"
:
# "History" is the title of Base_viewHistory form
content
=
part
.
get_payload
()
content
=
part
.
get_payload
(
decode
=
True
)
self
.
assertTrue
(
"History%s"
%
self
.
attachment_file_extension
in
content
)
self
.
assertTrue
(
"erp5/document_module"
in
content
)
tree
=
html
.
fromstring
(
content
)
link
,
=
[
href
for
href
in
tree
.
xpath
(
'//a/@href'
)
if
href
]
relative_url
=
urlparse
.
urlparse
(
link
)
report
=
self
.
publish
(
relative_url
.
path
+
"?"
+
relative_url
.
query
,
'%s:%s'
%
(
self
.
username
,
self
.
password
))
self
.
assertEqual
(
httplib
.
OK
,
report
.
getStatus
())
self
.
assertEqual
(
report
.
getHeader
(
'content-type'
),
self
.
content_type
)
break
else
:
self
.
fail
(
'Attachment not found in email
\
n
%s'
%
message_text
)
...
...
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