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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
4550b418
Commit
4550b418
authored
Jun 06, 2018
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testERP5Base: add a test to check reachability_workflow and coordinate_interaction_workflow
for Coordinates
parent
8ce379f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
143 additions
and
0 deletions
+143
-0
product/ERP5/tests/testERP5Base.py
product/ERP5/tests/testERP5Base.py
+143
-0
No files found.
product/ERP5/tests/testERP5Base.py
View file @
4550b418
...
...
@@ -1460,6 +1460,149 @@ class TestERP5Base(ERP5TypeTestCase):
],
)
def
test_CoordinateReachability
(
self
):
'''
Check the reachability_workflow and coordinate_interaction_workflow
for Coordinates
'''
portal_type
=
'Person'
person_module
=
self
.
portal
.
getDefaultModule
(
portal_type
)
person
=
person_module
.
newContent
(
portal_type
=
portal_type
)
# Address
address
=
person
.
newContent
(
portal_type
=
'Address'
)
self
.
assertEqual
(
address
.
getValidationState
(),
'reachable'
)
address
.
declareUnreachable
()
self
.
assertEqual
(
address
.
getValidationState
(),
'unreachable'
)
address
.
setStreetAddress
(
'Rue Nationale'
)
self
.
assertEqual
(
address
.
getValidationState
(),
'reachable'
)
self
.
tic
()
address
.
declareUnreachable
()
self
.
assertEqual
(
address
.
getValidationState
(),
'unreachable'
)
address
.
setZipCode
(
'59000'
)
self
.
assertEqual
(
address
.
getValidationState
(),
'reachable'
)
self
.
tic
()
address
.
declareUnreachable
()
self
.
assertEqual
(
address
.
getValidationState
(),
'unreachable'
)
address
.
setCity
(
'Lille'
)
self
.
assertEqual
(
address
.
getValidationState
(),
'reachable'
)
self
.
tic
()
address
.
declareUnreachable
()
self
.
assertEqual
(
address
.
getValidationState
(),
'unreachable'
)
address
.
setRegionValue
(
self
.
portal
.
portal_categories
.
region
.
europe
.
france
)
self
.
assertEqual
(
address
.
getValidationState
(),
'reachable'
)
self
.
tic
()
address
.
declareUnreachable
()
self
.
assertEqual
(
address
.
getValidationState
(),
'unreachable'
)
address
.
edit
(
zip_code
=
'59160'
,
street_address
=
'Rue Victor Hugo'
)
self
.
assertEqual
(
address
.
getValidationState
(),
'reachable'
)
# Telephone
telephone
=
person
.
newContent
(
portal_type
=
'Telephone'
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
telephone
.
declareUnreachable
()
self
.
assertEqual
(
telephone
.
getValidationState
(),
'unreachable'
)
telephone
.
setTelephoneCountry
(
'33'
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
self
.
tic
()
telephone
.
declareUnreachable
()
self
.
assertEqual
(
telephone
.
getValidationState
(),
'unreachable'
)
telephone
.
setTelephoneArea
(
'0'
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
self
.
tic
()
telephone
.
declareUnreachable
()
self
.
assertEqual
(
telephone
.
getValidationState
(),
'unreachable'
)
telephone
.
setTelephoneCity
(
'07'
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
self
.
tic
()
telephone
.
declareUnreachable
()
self
.
assertEqual
(
telephone
.
getValidationState
(),
'unreachable'
)
telephone
.
setTelephoneNumber
(
'12345678'
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
self
.
tic
()
telephone
.
declareUnreachable
()
self
.
assertEqual
(
telephone
.
getValidationState
(),
'unreachable'
)
telephone
.
setTelephoneExtension
(
'0'
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
self
.
tic
()
telephone
.
declareUnreachable
()
self
.
assertEqual
(
telephone
.
getValidationState
(),
'unreachable'
)
telephone
.
edit
(
telephone_country
=
'30'
,
telephone_number
=
'12345670'
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
self
.
tic
()
telephone
.
declareUnreachable
()
telephone
.
setCoordinateText
(
'+33-123.456.789'
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
self
.
tic
()
telephone
.
declareUnreachable
()
telephone
.
edit
(
coordinate_text
=
'+33-789 456 123 '
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'reachable'
)
# Check also that id we change a non-coordinate nothing happens
self
.
tic
()
telephone
.
declareUnreachable
()
telephone
.
edit
(
description
=
"This must be old number"
,
title
=
"telephone"
)
self
.
assertEqual
(
telephone
.
getValidationState
(),
'unreachable'
)
# Fax
fax
=
person
.
newContent
(
portal_type
=
'Fax'
)
self
.
assertEqual
(
fax
.
getValidationState
(),
'reachable'
)
self
.
tic
()
fax
.
declareUnreachable
()
self
.
assertEqual
(
fax
.
getValidationState
(),
'unreachable'
)
fax
.
setTelephoneCountry
(
'33'
)
self
.
assertEqual
(
fax
.
getValidationState
(),
'reachable'
)
self
.
tic
()
fax
.
declareUnreachable
()
self
.
assertEqual
(
fax
.
getValidationState
(),
'unreachable'
)
fax
.
setTelephoneArea
(
'0'
)
self
.
assertEqual
(
fax
.
getValidationState
(),
'reachable'
)
self
.
tic
()
fax
.
declareUnreachable
()
self
.
assertEqual
(
fax
.
getValidationState
(),
'unreachable'
)
fax
.
setTelephoneCity
(
'07'
)
self
.
assertEqual
(
fax
.
getValidationState
(),
'reachable'
)
self
.
tic
()
fax
.
declareUnreachable
()
self
.
assertEqual
(
fax
.
getValidationState
(),
'unreachable'
)
fax
.
setTelephoneNumber
(
'12345678'
)
self
.
assertEqual
(
fax
.
getValidationState
(),
'reachable'
)
self
.
tic
()
fax
.
declareUnreachable
()
self
.
assertEqual
(
fax
.
getValidationState
(),
'unreachable'
)
fax
.
setTelephoneExtension
(
'0'
)
self
.
assertEqual
(
fax
.
getValidationState
(),
'reachable'
)
# Email
email
=
person
.
newContent
(
portal_type
=
'Email'
)
self
.
assertEqual
(
email
.
getValidationState
(),
'reachable'
)
self
.
tic
()
email
.
declareUnreachable
()
self
.
assertEqual
(
email
.
getValidationState
(),
'unreachable'
)
email
.
setCoordinateText
(
'test@text.com'
)
self
.
assertEqual
(
email
.
getValidationState
(),
'reachable'
)
# External Identifier
external_identifier
=
person
.
newContent
(
portal_type
=
'External Identifier'
)
self
.
assertEqual
(
external_identifier
.
getValidationState
(),
'reachable'
)
self
.
tic
()
external_identifier
.
declareUnreachable
()
self
.
assertEqual
(
external_identifier
.
getValidationState
(),
'unreachable'
)
external_identifier
.
setCoordinateText
(
'test'
)
self
.
assertEqual
(
external_identifier
.
getValidationState
(),
'reachable'
)
# Link
link
=
person
.
newContent
(
portal_type
=
'Link'
)
self
.
assertEqual
(
link
.
getValidationState
(),
'reachable'
)
self
.
tic
()
link
.
declareUnreachable
()
self
.
assertEqual
(
link
.
getValidationState
(),
'unreachable'
)
link
.
setUrlString
(
'www.dummy-link.com'
)
self
.
assertEqual
(
link
.
getValidationState
(),
'reachable'
)
# Chat Address
chat_address
=
person
.
newContent
(
portal_type
=
'Chat Address'
)
self
.
assertEqual
(
chat_address
.
getValidationState
(),
'reachable'
)
self
.
tic
()
chat_address
.
declareUnreachable
()
self
.
assertEqual
(
chat_address
.
getValidationState
(),
'unreachable'
)
chat_address
.
setUrlString
(
'www.dummy-chat.com'
)
self
.
assertEqual
(
chat_address
.
getValidationState
(),
'reachable'
)
# Do a final tic to make sure no activities fail
self
.
tic
()
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestERP5Base
))
...
...
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