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
Klaus Wölfel
erp5
Commits
443544d1
Commit
443544d1
authored
Sep 14, 2022
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core_test: add unit test for getFutureStateSet
parent
69a32bff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
...plateItem/portal_components/test.erp5.testERP5Workflow.py
+15
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
View file @
443544d1
...
@@ -81,6 +81,21 @@ class TestERP5Workflow(ERP5TypeTestCase):
...
@@ -81,6 +81,21 @@ class TestERP5Workflow(ERP5TypeTestCase):
workflow
.
_executeTransition
(
doc
,
transition1
)
workflow
.
_executeTransition
(
doc
,
transition1
)
self
.
assertEqual
(
'state2'
,
workflow
.
_getWorkflowStateOf
(
doc
,
id_only
=
1
))
self
.
assertEqual
(
'state2'
,
workflow
.
_getWorkflowStateOf
(
doc
,
id_only
=
1
))
# check getFutureStateSet
self
.
assertEqual
({
'state1'
,
'state2'
},
workflow
.
getFutureStateSet
(
'state1'
))
self
.
assertEqual
({
'state2'
},
workflow
.
getFutureStateSet
(
'state2'
))
state3
=
workflow
.
newContent
(
portal_type
=
'Workflow State'
,
title
=
'State 3'
)
state3
.
setReference
(
'state3'
)
self
.
assertEqual
({
'state1'
,
'state2'
},
workflow
.
getFutureStateSet
(
'state1'
))
self
.
assertEqual
({
'state2'
},
workflow
.
getFutureStateSet
(
'state2'
))
transition2
=
workflow
.
newContent
(
portal_type
=
'Workflow Transition'
,
title
=
'Transition 1'
)
transition2
.
setReference
(
'transition2'
)
transition2
.
setDestinationValue
(
state3
)
state1
.
setDestinationValueList
([
transition1
,
transition2
])
self
.
assertEqual
({
'state1'
,
'state2'
,
'state3'
},
workflow
.
getFutureStateSet
(
'state1'
))
self
.
assertEqual
({
'state2'
},
workflow
.
getFutureStateSet
(
'state2'
))
def
test_getAvailableTransitionList
(
self
):
def
test_getAvailableTransitionList
(
self
):
workflow
=
self
.
workflow_module
.
newContent
(
portal_type
=
'Workflow'
)
workflow
=
self
.
workflow_module
.
newContent
(
portal_type
=
'Workflow'
)
...
...
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