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
alecs_myu
erp5
Commits
3ecb4c20
Commit
3ecb4c20
authored
Oct 31, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test untranslatable columns in odt & ods style
parent
b4126ad6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
product/ERP5OOo/tests/testOOoStyle.py
product/ERP5OOo/tests/testOOoStyle.py
+37
-3
No files found.
product/ERP5OOo/tests/testOOoStyle.py
View file @
3ecb4c20
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
import
unittest
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
,
\
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
,
\
_getConversionServerDict
_getConversionServerDict
from
Products.ERP5Type.tests.utils
import
DummyLocalizer
from
Products.ERP5Form.Selection
import
Selection
from
Products.ERP5Form.Selection
import
Selection
from
Testing
import
ZopeTestCase
from
Testing
import
ZopeTestCase
from
Products.ERP5OOo.tests.utils
import
Validator
from
Products.ERP5OOo.tests.utils
import
Validator
...
@@ -46,8 +47,8 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -46,8 +47,8 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
content_type
=
None
content_type
=
None
def
getBusinessTemplateList
(
self
):
def
getBusinessTemplateList
(
self
):
return
(
'erp5_core_proxy_field_legacy'
,
return
(
'erp5_core_proxy_field_legacy'
,
'erp5_ui_test'
,
'erp5_base'
,
'erp5_
base'
,
'erp5_
ods_style'
,
'erp5_odt_style'
,)
'erp5_ods_style'
,
'erp5_odt_style'
,)
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
if
not
self
.
skin
:
if
not
self
.
skin
:
...
@@ -389,6 +390,39 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -389,6 +390,39 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
content_xml
=
parser
.
oo_files
[
'content.xml'
]
content_xml
=
parser
.
oo_files
[
'content.xml'
]
self
.
assert_
(
'<Escape>&<text:line-break/>newline'
in
content_xml
)
self
.
assert_
(
'<Escape>&<text:line-break/>newline'
in
content_xml
)
def
test_untranslatable_columns
(
self
):
self
.
portal
.
ListBoxZuite_reset
()
self
.
portal
.
Localizer
=
DummyLocalizer
()
message_catalog
=
self
.
portal
.
Localizer
.
erp5_ui
# XXX odt style does not seem to display a listbox if it is empty ???
self
.
portal
.
foo_module
.
newContent
(
portal_type
=
'Foo'
)
message
=
self
.
id
()
self
.
portal
.
FooModule_viewFooList
.
listbox
.
ListBox_setPropertyList
(
field_columns
=
[
'do_not_translate | %s'
%
message
,],
field_untranslatablecolumns
=
[
'do_not_translate | %s'
%
message
,],
)
self
.
tic
()
self
.
portal
.
changeSkin
(
self
.
skin
)
response
=
self
.
publish
(
'/%s/foo_module/FooModule_viewFooList?portal_skin='
%
self
.
portal
.
getId
(),
self
.
auth
)
self
.
assertEquals
(
HTTP_OK
,
response
.
getStatus
())
content_type
=
response
.
getHeader
(
'content-type'
)
self
.
assertTrue
(
content_type
.
startswith
(
self
.
content_type
),
content_type
)
content_disposition
=
response
.
getHeader
(
'content-disposition'
)
self
.
assertEquals
(
'attachment'
,
content_disposition
.
split
(
';'
)[
0
])
body
=
response
.
getBody
()
self
.
_validate
(
body
)
from
Products.ERP5OOo.OOoUtils
import
OOoParser
parser
=
OOoParser
()
parser
.
openFromString
(
body
)
content_xml
=
parser
.
oo_files
[
'content.xml'
]
self
.
assertTrue
(
message
in
content_xml
)
# This untranslatable column have not been translated
self
.
assertTrue
(
message
not
in
message_catalog
.
_translated
)
class
TestODTStyle
(
TestOOoStyle
):
class
TestODTStyle
(
TestOOoStyle
):
skin
=
'ODT'
skin
=
'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