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
Matevz Golob
erp5
Commits
62dafa78
Commit
62dafa78
authored
Jul 05, 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: modification due to null workflow prefix.
parent
1b32e1f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
26 deletions
+22
-26
bt5/erp5_workflow_test_data/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
.../portal_components/test.erp5.testWorkflowAndDCWorkflow.py
+22
-26
No files found.
bt5/erp5_workflow_test_data/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
View file @
62dafa78
...
...
@@ -16,10 +16,8 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
pass
def
doActionFor
(
self
,
document
,
action
):
"""
Need to be overidden
"""
pass
user_action
=
action
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
'testing_workflow'
)
def
getWorklistDocumentCountFromActionName
(
self
,
action_name
):
self
.
assertEqual
(
action_name
[
-
1
],
')'
)
...
...
@@ -195,16 +193,23 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
self
.
assertEqual
(
self
.
getStateFor
(
new_object
),
'validated'
)
self
.
assertEqual
(
workflow_tool
.
isTransitionPossible
(
new_object
,
'invalidate'
),
1
)
def
test_13_testWorkflowHistroyBeforeAndAfterConversion
(
self
):
pass
"""
def beforeTearDown(self):
self.abort()
self.portal = self.getPortal()
self.getWorkflowTool().setChainForPortalTypes(['ERP5Workflow Test Document'], ())
type_test_object = self.portal.portal_types._getOb('ERP5Workflow Test Document')
type_test_object.edit(type_base_category_list=('validation_state',))
type_test_object.edit(type_workflow_list=('testing_workflow',))
#self.commit()
workflow_module = self.portal.portal_workflow
workflow_module._delObject('testing_workflow')
workflow_module._delObject('testing_interaction_workflow')
workflow_module.testing_workflow = workflow_module.get('testing_workflow_backup')
workflow_module.testing_workflow.id = 'testing_workflow'
workflow_module.testing_interaction_workflow = workflow_module.get('testing_interaction_workflow_backup')
workflow_module.testing_interaction_workflow.id = 'testing_interaction_workflow'
super(TestERP5WorkflowMixin, self).beforeTearDown()
"""
class
TestConvertedWorkflow
(
TestERP5WorkflowMixin
):
"""
Tests Converted Workflow.
...
...
@@ -221,16 +226,15 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
for
dc_wf_id
in
dc_wf_id_list
:
self
.
workflow_module
.
delTypeCBT
(
ptype_id
,
dc_wf_id
)
if
not
hasattr
(
self
.
workflow_module
,
'workflow_'
+
dc_wf_id
)
and
not
hasattr
(
self
.
workflow_module
,
'interactionworkflow_'
+
dc_wf_id
):
# convert DC workflow to workflow:
dc_wf
=
self
.
workflow_module
.
_getOb
(
dc_wf_id
)
if
dc_wf
.
getPortalType
()
not
in
[
'Workflow'
,
'Interaction Workflow'
]:
self
.
workflow_module
.
dc_workflow_asERP5Object
(
self
.
workflow_module
,
dc_wf
,
temp
=
0
)
#type_test_object.addTypeWorkflowList(workflow.id)
type_test_object
.
addTypeWorkflowList
(
'
interactionworkflow_
testing_interaction_workflow'
)
type_test_object
.
addTypeWorkflowList
(
'
workflow_
testing_workflow'
)
type_test_object
.
addTypeWorkflowList
(
'testing_interaction_workflow'
)
type_test_object
.
addTypeWorkflowList
(
'testing_workflow'
)
self
.
wf
=
self
.
workflow_module
.
_getOb
(
'
workflow_testing_workflow'
)
# workflow id comes with suffix
self
.
wf
=
self
.
workflow_module
.
_getOb
(
'
testing_workflow'
)
self
.
resetComponentTool
()
self
.
assertFalse
(
'testing_workflow'
in
self
.
getWorkflowTool
().
getChainFor
(
type_test_object
.
getId
()))
self
.
login
()
...
...
@@ -238,10 +242,6 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
def
getStateFor
(
self
,
document
):
return
getattr
(
document
,
'getValidationState'
)()
def
doActionFor
(
self
,
document
,
action
):
user_action
=
action
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
'workflow_testing_workflow'
)
class
TestDCWorkflow
(
TestERP5WorkflowMixin
):
"""
Check DC Workflow
...
...
@@ -261,12 +261,8 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
def
getStateFor
(
self
,
document
):
return
self
.
wf
.
_getWorkflowStateOf
(
document
,
id_only
=
True
)
def
doActionFor
(
self
,
document
,
action
):
user_action
=
action
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
'testing_workflow'
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestConvertedWorkflow
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestDCWorkflow
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestConvertedWorkflow
))
return
suite
\ No newline at end of file
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