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
1
Issues
1
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
Roque
erp5
Commits
04a7de19
Commit
04a7de19
authored
Jan 10, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix assertion that were always true
parent
841b0206
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
product/ERP5OOo/tests/testOOoDynamicStyle.py
product/ERP5OOo/tests/testOOoDynamicStyle.py
+6
-6
No files found.
product/ERP5OOo/tests/testOOoDynamicStyle.py
View file @
04a7de19
...
...
@@ -127,7 +127,7 @@ return getattr(context, "%s_%s" % (parameter, current_language))
self
.
assertEqual
(
'attachment; filename="Dynamic_viewAsOdt.odt"'
,
response
.
getHeader
(
'content-disposition'
))
self
.
_validate
(
response
.
getBody
())
self
.
assert
True
(
200
,
response
.
getStatus
())
self
.
assert
Equals
(
200
,
response
.
getStatus
())
ooo_builder
=
OOoBuilder
(
response
.
getBody
())
styles_xml_body
=
ooo_builder
.
extract
(
'styles.xml'
)
...
...
@@ -157,7 +157,7 @@ return getattr(context, "%s_%s" % (parameter, current_language))
response
=
self
.
publish
(
'/'
+
self
.
getPortal
().
Dynamic_viewAsOdt
.
absolute_url
(
1
))
# then, it is not a zip stream
self
.
assertFalse
(
response
.
getBody
().
startswith
(
'PK'
))
self
.
assert
True
(
500
,
response
.
getStatus
())
self
.
assert
Equals
(
500
,
response
.
getStatus
())
def
test_02_static
(
self
):
...
...
@@ -176,7 +176,7 @@ return getattr(context, "%s_%s" % (parameter, current_language))
# 1. test a normal case
response
=
self
.
publish
(
'/'
+
self
.
getPortal
().
Static_viewAsOdt
.
absolute_url
(
1
))
self
.
assert
True
(
200
,
response
.
getStatus
())
self
.
assert
Equal
(
200
,
response
.
getStatus
())
self
.
assertEqual
(
'application/vnd.oasis.opendocument.text'
,
response
.
getHeader
(
'content-type'
).
split
(
';'
)[
0
])
self
.
assertEqual
(
'attachment; filename="Static_viewAsOdt.odt"'
,
...
...
@@ -192,7 +192,7 @@ return getattr(context, "%s_%s" % (parameter, current_language))
Static_viewAsOdt
.
doSettings
(
request
,
title
=
''
,
xml_file_id
=
'content.xml'
,
ooo_stylesheet
=
'Test_getODTStyleSheet_en'
,
script_name
=
''
)
response
=
self
.
publish
(
'/'
+
self
.
getPortal
().
Static_viewAsOdt
.
absolute_url
(
1
))
self
.
assert
True
(
200
,
response
.
getStatus
())
self
.
assert
Equal
(
200
,
response
.
getStatus
())
self
.
_validate
(
response
.
getBody
())
ooo_builder
=
OOoBuilder
(
response
.
getBody
())
styles_xml_body
=
ooo_builder
.
extract
(
'styles.xml'
)
...
...
@@ -205,7 +205,7 @@ return getattr(context, "%s_%s" % (parameter, current_language))
ooo_stylesheet
=
'NotFound_getODTStyleSheet'
,
script_name
=
''
)
response
=
self
.
publish
(
'/'
+
self
.
getPortal
().
Static_viewAsOdt
.
absolute_url
(
1
))
self
.
assertFalse
(
response
.
getBody
().
startswith
(
'PK'
))
self
.
assert
True
(
500
,
response
.
getStatus
())
self
.
assert
Equals
(
500
,
response
.
getStatus
())
def
test_include_img
(
self
):
"""
...
...
@@ -236,7 +236,7 @@ return getattr(context, "%s_%s" % (parameter, current_language))
response
=
self
.
publish
(
'/'
+
self
.
getPortal
().
Base_viewIncludeImageAsOdt
.
absolute_url
(
1
))
body
=
response
.
getBody
()
self
.
assert
True
(
200
,
response
.
getStatus
(),
body
)
self
.
assert
Equals
(
200
,
response
.
getStatus
(),
body
)
self
.
assertEqual
(
'application/vnd.oasis.opendocument.text'
,
response
.
getHeader
(
'content-type'
).
split
(
';'
)[
0
])
self
.
assertEqual
(
'attachment; filename="Base_viewIncludeImageAsOdt.odt"'
,
...
...
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