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
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
6316d9bb
Commit
6316d9bb
authored
Oct 24, 2024
by
Jérome Perrin
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formulator: test form serialization with non ascii elements
parent
68a7274c
Pipeline
#37678
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
product/Formulator/tests/testSerializeForm.py
product/Formulator/tests/testSerializeForm.py
+35
-0
No files found.
product/Formulator/tests/testSerializeForm.py
View file @
6316d9bb
...
@@ -189,6 +189,41 @@ class SerializeTestCase(unittest.TestCase):
...
@@ -189,6 +189,41 @@ class SerializeTestCase(unittest.TestCase):
# if we have forgotten something, this will usually remind us ;-)
# if we have forgotten something, this will usually remind us ;-)
self
.
assertEqual
(
form
.
render
(),
form2
.
render
())
self
.
assertEqual
(
form
.
render
(),
form2
.
render
())
def
test_encoding
(
self
):
"""test a form with non ascii string
"""
form
=
ZMIForm
(
'test'
,
'<EncodingTest>'
)
form
.
name
=
'name'
form
.
add_group
(
'àbcdé'
)
form
.
manage_addField
(
'string_field'
,
'string Field héhé'
,
'StringField'
)
form
.
manage_addField
(
'int_field'
,
'int Field héhé'
,
'IntegerField'
)
form
.
manage_addField
(
'float_field'
,
'Float Field héhé'
,
'FloatField'
)
form
.
manage_addField
(
'date_field'
,
'Date Field héhé'
,
'DateTimeField'
)
form
.
manage_addField
(
'list_field'
,
'List Field héhé'
,
'ListField'
)
form
.
manage_addField
(
'multi_field'
,
'Checkbox Field héhé'
,
'MultiCheckBoxField'
)
form2
=
ZMIForm
(
'test2'
,
'ValueTest'
)
xml
=
formToXML
(
form
)
XMLToForm
(
xml
,
form2
)
for
field
in
form
.
get_fields
():
self
.
assertTrue
(
form2
.
has_field
(
field
.
getId
()))
field2
=
getattr
(
form2
,
field
.
getId
())
self
.
assertEqual
(
field
.
values
,
field2
.
values
)
# test if default renderings are the same
self
.
assertEqual
(
field
.
render
(),
field2
.
render
())
self
.
assertEqual
(
form
.
title
,
form2
.
title
)
self
.
assertEqual
(
form
.
name
,
form2
.
name
)
self
.
assertEqual
(
form
.
action
,
form2
.
action
)
self
.
assertEqual
(
form
.
enctype
,
form2
.
enctype
)
self
.
assertEqual
(
form
.
method
,
form2
.
method
)
# if we have forgotten something, this will usually remind us ;-)
self
.
assertEqual
(
form
.
render
(),
form2
.
render
())
def
test_messages
(
self
):
def
test_messages
(
self
):
""" test if the error messages are exported
""" test if the error messages are exported
...
...
Jérome Perrin
@jerome
mentioned in commit
11d907d7
·
Nov 11, 2024
mentioned in commit
11d907d7
mentioned in commit 11d907d7bca0c384b9bfe2fc821a90b8aa9a3f66
Toggle commit list
Jérome Perrin
@jerome
mentioned in commit
c1a277b7
·
Nov 12, 2024
mentioned in commit
c1a277b7
mentioned in commit c1a277b742cdaeff7bce2e58ad5a816f8e0cc30b
Toggle commit list
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