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
0a830889
Commit
0a830889
authored
Jan 31, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testFormPrintoutAsODG: py3
parent
5f92128a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
product/ERP5OOo/tests/testFormPrintoutAsODG.py
product/ERP5OOo/tests/testFormPrintoutAsODG.py
+6
-6
No files found.
product/ERP5OOo/tests/testFormPrintoutAsODG.py
View file @
0a830889
...
@@ -403,7 +403,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
...
@@ -403,7 +403,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
# check the style is keept after the odg generation
# check the style is keept after the odg generation
self
.
assertEqual
(
final_document_style_dict
,
style_dict
)
self
.
assertEqual
(
final_document_style_dict
,
style_dict
)
self
.
assert
True
(
content_xml
.
find
(
"Foo title!"
)
>
0
)
self
.
assert
In
(
b"Foo title!"
,
content_xml
)
self
.
assertEqual
(
request
.
RESPONSE
.
getHeader
(
'content-type'
),
self
.
assertEqual
(
request
.
RESPONSE
.
getHeader
(
'content-type'
),
'application/vnd.oasis.opendocument.graphics'
)
'application/vnd.oasis.opendocument.graphics'
)
self
.
assertEqual
(
request
.
RESPONSE
.
getHeader
(
'content-disposition'
),
self
.
assertEqual
(
request
.
RESPONSE
.
getHeader
(
'content-disposition'
),
...
@@ -417,7 +417,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
...
@@ -417,7 +417,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
self
.
assertTrue
(
odf_document
is
not
None
)
self
.
assertTrue
(
odf_document
is
not
None
)
builder
=
OOoBuilder
(
odf_document
)
builder
=
OOoBuilder
(
odf_document
)
content_xml
=
builder
.
extract
(
"content.xml"
)
content_xml
=
builder
.
extract
(
"content.xml"
)
self
.
assert
True
(
content_xml
.
find
(
"Changed Title!"
)
>
0
)
self
.
assert
In
(
b"Changed title!"
,
content_xml
)
self
.
_validate
(
odf_document
)
self
.
_validate
(
odf_document
)
# 3. False case: change the field name
# 3. False case: change the field name
...
@@ -429,7 +429,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
...
@@ -429,7 +429,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
self
.
assertTrue
(
odf_document
is
not
None
)
self
.
assertTrue
(
odf_document
is
not
None
)
builder
=
OOoBuilder
(
odf_document
)
builder
=
OOoBuilder
(
odf_document
)
content_xml
=
builder
.
extract
(
"content.xml"
)
content_xml
=
builder
.
extract
(
"content.xml"
)
self
.
assert
False
(
content_xml
.
find
(
"you cannot find"
)
>
0
)
self
.
assert
NotIn
(
b"you cannot find"
,
content_xml
)
self
.
_validate
(
odf_document
)
self
.
_validate
(
odf_document
)
# put back
# put back
foo_form
.
manage_renameObject
(
'xxx_title'
,
'my_title'
,
REQUEST
=
request
)
foo_form
.
manage_renameObject
(
'xxx_title'
,
'my_title'
,
REQUEST
=
request
)
...
@@ -449,7 +449,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
...
@@ -449,7 +449,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
self
.
assertTrue
(
odf_document
is
not
None
)
self
.
assertTrue
(
odf_document
is
not
None
)
builder
=
OOoBuilder
(
odf_document
)
builder
=
OOoBuilder
(
odf_document
)
content_xml
=
builder
.
extract
(
"content.xml"
)
content_xml
=
builder
.
extract
(
"content.xml"
)
self
.
assert
True
(
content_xml
.
find
(
"call!"
)
>
0
)
self
.
assert
In
(
b"call!"
,
content_xml
)
self
.
assertEqual
(
request
.
RESPONSE
.
getHeader
(
'content-type'
),
self
.
assertEqual
(
request
.
RESPONSE
.
getHeader
(
'content-type'
),
'application/vnd.oasis.opendocument.graphics'
)
'application/vnd.oasis.opendocument.graphics'
)
self
.
_validate
(
odf_document
)
self
.
_validate
(
odf_document
)
...
@@ -460,7 +460,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
...
@@ -460,7 +460,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
self
.
assertTrue
(
odf_document
is
not
None
)
self
.
assertTrue
(
odf_document
is
not
None
)
builder
=
OOoBuilder
(
odf_document
)
builder
=
OOoBuilder
(
odf_document
)
content_xml
=
builder
.
extract
(
"content.xml"
)
content_xml
=
builder
.
extract
(
"content.xml"
)
self
.
assert
True
(
content_xml
.
find
(
"Français"
)
>
0
)
self
.
assert
In
(
"Français"
.
encode
(
'utf-8'
),
content_xml
)
self
.
_validate
(
odf_document
)
self
.
_validate
(
odf_document
)
# 6. Normal case: unicode string
# 6. Normal case: unicode string
...
@@ -469,7 +469,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
...
@@ -469,7 +469,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
self
.
assertTrue
(
odf_document
is
not
None
)
self
.
assertTrue
(
odf_document
is
not
None
)
builder
=
OOoBuilder
(
odf_document
)
builder
=
OOoBuilder
(
odf_document
)
content_xml
=
builder
.
extract
(
"content.xml"
)
content_xml
=
builder
.
extract
(
"content.xml"
)
self
.
assert
True
(
content_xml
.
find
(
"Français test2"
)
>
0
)
self
.
assert
In
(
"Français test2"
.
encode
(
'utf-8'
),
content_xml
)
self
.
_validate
(
odf_document
)
self
.
_validate
(
odf_document
)
def
test_suite
():
def
test_suite
():
...
...
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