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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mukul
erp5
Commits
2d37b787
Commit
2d37b787
authored
Mar 19, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_workflow_test_date: doActionFor merged for both cases.
parent
06fbc7e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
17 deletions
+8
-17
bt5/erp5_workflow_test_data/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
.../portal_components/test.erp5.testWorkflowAndDCWorkflow.py
+8
-17
No files found.
bt5/erp5_workflow_test_data/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
View file @
2d37b787
...
...
@@ -104,6 +104,10 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
type_test_object
.
edit
(
type_erp5workflow_list
=
(
'testing_workflow'
,))
self
.
getWorkflowTool
().
setChainForPortalTypes
([
'ERP5Workflow Test Document'
],
())
def
doActionFor
(
self
,
document
,
action
):
user_action
=
action
+
'_action'
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
'testing_workflow'
)
#getattr(document, convertToMixedCase(action))()
class
TestERP5Workflow
(
TestERP5WorkflowMixin
):
"""
...
...
@@ -118,16 +122,9 @@ class TestERP5Workflow(TestERP5WorkflowMixin):
type_test_object
.
edit
(
type_base_category_list
=
(
'validation_state'
,))
type_test_object
.
edit
(
type_erp5workflow_list
=
(
'testing_workflow'
,))
self
.
resetComponentTool
()
self
.
assertFalse
(
'testing_workflow'
in
self
.
getWorkflowTool
().
getChainFor
(
type_test_object
.
getId
()))
self
.
login
()
# as Manager
def
doActionFor
(
self
,
document
,
action
):
# check testing_workflow is not in use
self
.
assertFalse
(
'testing_workflow'
in
self
.
getWorkflowTool
().
getChainFor
(
document
.
getTypeInfo
().
getId
()))
#getattr(document, convertToMixedCase(action))()
user_action
=
action
+
'_action'
self
.
getWorkflowTool
().
doActionFor
(
document
,
user_action
)
#self.wf.doActionFor(document, user_action)
def
getStateFor
(
self
,
document
):
return
getattr
(
document
,
'getValidationState'
)()
...
...
@@ -141,20 +138,14 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
self
.
workflow_module
=
self
.
portal
.
portal_workflow
self
.
getWorkflowTool
().
setChainForPortalTypes
([
'ERP5Workflow Test Document'
],
(
'testing_workflow'
))
self
.
wf
=
self
.
workflow_module
.
_getOb
(
'testing_workflow'
)
type_test_object
=
self
.
portal
.
portal_types
.
_getOb
(
'ERP5Workflow Test Document'
)
type_test_object
=
self
.
portal
.
portal_types
[
'ERP5Workflow Test Document'
]
type_test_object
.
edit
(
type_base_category_list
=
())
type_test_object
.
edit
(
type_erp5workflow_list
=
())
self
.
resetComponentTool
()
self
.
assertTrue
(
self
.
wf
.
getId
()
in
self
.
getWorkflowTool
().
getChainFor
(
type_test_object
.
getId
()))
self
.
assertEqual
(
type_test_object
.
getTypeErp5workflowList
(),
[])
self
.
login
()
def
doActionFor
(
self
,
document
,
action
):
self
.
assertTrue
(
self
.
wf
.
getId
()
in
self
.
getWorkflowTool
().
getChainFor
(
document
.
getTypeInfo
().
getId
()))
# check erp5workflow is not in use
self
.
assertEqual
(
document
.
getTypeInfo
().
getTypeErp5workflowList
(),
[])
user_action
=
action
+
'_action'
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
self
.
wf
.
getId
())
#getattr(document, convertToMixedCase(action))()
def
getStateFor
(
self
,
document
):
return
self
.
wf
.
_getWorkflowStateOf
(
document
,
id_only
=
True
)
...
...
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