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
7c880735
Commit
7c880735
authored
Jun 12, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_workflow_test_data: rewrite live test so it can be used for conversion test also.
parent
6dc4a333
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
bt5/erp5_workflow_test_data/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
.../portal_components/test.erp5.testWorkflowAndDCWorkflow.py
+18
-5
No files found.
bt5/erp5_workflow_test_data/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
View file @
7c880735
...
...
@@ -217,11 +217,24 @@ class TestERP5Workflow(TestERP5WorkflowMixin):
"""
def
afterSetUp
(
self
):
self
.
portal
=
self
.
getPortal
()
self
.
getWorkflowTool
().
setChainForPortalTypes
([
'ERP5Workflow Test Document'
],
())
self
.
workflow_module
=
self
.
portal
.
portal_workflow
dc_wf_id_list
=
[
'testing_workflow'
,
'testing_interaction_workflow'
]
ptype_id
=
'ERP5Workflow Test Document'
type_test_object
=
self
.
portal
.
portal_types
.
_getOb
(
ptype_id
)
for
dc_wf_id
in
dc_wf_id_list
:
if
hasattr
(
self
.
workflow_module
,
'workflow_'
+
dc_wf_id
)
or
hasattr
(
self
.
workflow_module
,
'interactionworkflow_'
+
dc_wf_id
):
# already existed converted workflow
continue
# clean _chain_by_type assignment
self
.
workflow_module
.
delTypeCBT
(
ptype_id
,
dc_wf_id
)
# convert DC workflow to workflow:
dc_wf
=
self
.
workflow_module
.
_getOb
(
dc_wf_id
)
workflow
=
self
.
workflow_module
.
dc_workflow_asERP5Object
(
self
.
workflow_module
,
dc_wf
,
temp
=
0
)
# assign new converted workflow;
type_test_object
.
addTypeWorkflowList
(
workflow
.
getId
())
self
.
wf
=
self
.
workflow_module
.
_getOb
(
'workflow_testing_workflow'
)
# workflow id comes with suffix
type_test_object
=
self
.
portal
.
portal_types
.
_getOb
(
'ERP5Workflow Test Document'
)
type_test_object
.
edit
(
type_workflow_list
=
(
'workflow_testing_workflow'
,
'interactionworkflow_testing_interaction_workflow'
,
))
self
.
resetComponentTool
()
self
.
assertFalse
(
'testing_workflow'
in
self
.
getWorkflowTool
().
getChainFor
(
type_test_object
.
getId
()))
self
.
login
()
...
...
@@ -230,7 +243,7 @@ class TestERP5Workflow(TestERP5WorkflowMixin):
return
getattr
(
document
,
'getValidationState'
)()
def
doActionFor
(
self
,
document
,
action
):
user_action
=
'transition_'
+
action
user_action
=
action
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
'workflow_testing_workflow'
)
class
TestDCWorkflow
(
TestERP5WorkflowMixin
):
...
...
@@ -246,7 +259,7 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
type_test_object
=
self
.
portal
.
portal_types
[
'ERP5Workflow Test Document'
]
type_test_object
.
edit
(
type_workflow_list
=
())
self
.
resetComponentTool
()
self
.
assertEqual
(
type_test_object
.
getType
w
orkflowList
(),
[])
self
.
assertEqual
(
type_test_object
.
getType
W
orkflowList
(),
[])
self
.
login
()
def
getStateFor
(
self
,
document
):
...
...
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