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
Laurent S
erp5
Commits
d6cf2eda
Commit
d6cf2eda
authored
Jun 17, 2011
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test Coordinate PropertySheet and new API
parent
dfddf562
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
product/ERP5/tests/testERP5Coordinate.py
product/ERP5/tests/testERP5Coordinate.py
+28
-0
No files found.
product/ERP5/tests/testERP5Coordinate.py
View file @
d6cf2eda
...
@@ -58,6 +58,34 @@ class TestERP5Coordinate(ERP5TypeTestCase):
...
@@ -58,6 +58,34 @@ class TestERP5Coordinate(ERP5TypeTestCase):
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
def
test_data_coordinate_text_property
(
self
):
"""Check New Coordinate API:
asText compute printable value
setData store user value
getData return user value
"""
person
=
self
.
getPersonModule
().
newContent
(
portal_type
=
'Person'
)
# check telephone
telephone
=
person
.
newContent
(
portal_type
=
'Telephone'
)
self
.
assertEquals
(
telephone
.
getCoordinateText
(),
None
)
self
.
assertEquals
(
telephone
.
getCoordinateText
(
''
),
''
)
phone_number
=
'0320595959'
telephone
.
setCoordinateText
(
phone_number
)
self
.
assertEquals
(
telephone
.
getCoordinateText
(),
phone_number
)
self
.
assertEquals
(
telephone
.
asText
(),
'+(0)-'
+
phone_number
)
# check address
address
=
person
.
newContent
(
portal_type
=
'Address'
)
self
.
assertEquals
(
address
.
getCoordinateText
(),
None
)
self
.
assertEquals
(
address
.
getCoordinateText
(
''
),
''
)
address_text
=
"""15 flower street
75016 PARIS"""
address
.
setCoordinateText
(
address_text
)
self
.
assertEquals
(
address
.
getCoordinateText
(),
address_text
)
self
.
assertEquals
(
address
.
asText
(),
address_text
)
# Old API check backward compatibility
def
test_TelephoneAsText
(
self
):
def
test_TelephoneAsText
(
self
):
# Test asText method
# Test asText method
pers
=
self
.
getPersonModule
().
newContent
(
portal_type
=
'Person'
)
pers
=
self
.
getPersonModule
().
newContent
(
portal_type
=
'Person'
)
...
...
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