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
1
Issues
1
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
Roque
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
Hide 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):
...
@@ -16,10 +16,8 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
pass
pass
def
doActionFor
(
self
,
document
,
action
):
def
doActionFor
(
self
,
document
,
action
):
"""
user_action
=
action
Need to be overidden
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
'testing_workflow'
)
"""
pass
def
getWorklistDocumentCountFromActionName
(
self
,
action_name
):
def
getWorklistDocumentCountFromActionName
(
self
,
action_name
):
self
.
assertEqual
(
action_name
[
-
1
],
')'
)
self
.
assertEqual
(
action_name
[
-
1
],
')'
)
...
@@ -195,16 +193,23 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
...
@@ -195,16 +193,23 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
self
.
assertEqual
(
self
.
getStateFor
(
new_object
),
'validated'
)
self
.
assertEqual
(
self
.
getStateFor
(
new_object
),
'validated'
)
self
.
assertEqual
(
workflow_tool
.
isTransitionPossible
(
new_object
,
'invalidate'
),
1
)
self
.
assertEqual
(
workflow_tool
.
isTransitionPossible
(
new_object
,
'invalidate'
),
1
)
def
test_13_testWorkflowHistroyBeforeAndAfterConversion
(
self
):
pass
"""
"""
def beforeTearDown(self):
def beforeTearDown(self):
self.abort()
self.portal = self.getPortal()
self.portal = self.getPortal()
self.getWorkflowTool().setChainForPortalTypes(['ERP5Workflow Test Document'], ())
workflow_module = self.portal.portal_workflow
type_test_object = self.portal.portal_types._getOb('ERP5Workflow Test Document')
workflow_module._delObject('testing_workflow')
type_test_object.edit(type_base_category_list=('validation_state',))
workflow_module._delObject('testing_interaction_workflow')
type_test_object.edit(type_workflow_list=('testing_workflow',))
workflow_module.testing_workflow = workflow_module.get('testing_workflow_backup')
#self.commit()
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
):
class
TestConvertedWorkflow
(
TestERP5WorkflowMixin
):
"""
"""
Tests Converted Workflow.
Tests Converted Workflow.
...
@@ -221,16 +226,15 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
...
@@ -221,16 +226,15 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
for
dc_wf_id
in
dc_wf_id_list
:
for
dc_wf_id
in
dc_wf_id_list
:
self
.
workflow_module
.
delTypeCBT
(
ptype_id
,
dc_wf_id
)
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
):
dc_wf
=
self
.
workflow_module
.
_getOb
(
dc_wf_id
)
# convert DC workflow to workflow:
if
dc_wf
.
getPortalType
()
not
in
[
'Workflow'
,
'Interaction Workflow'
]:
dc_wf
=
self
.
workflow_module
.
_getOb
(
dc_wf_id
)
self
.
workflow_module
.
dc_workflow_asERP5Object
(
self
.
workflow_module
,
dc_wf
,
temp
=
0
)
self
.
workflow_module
.
dc_workflow_asERP5Object
(
self
.
workflow_module
,
dc_wf
,
temp
=
0
)
#type_test_object.addTypeWorkflowList(workflow.id)
#type_test_object.addTypeWorkflowList(workflow.id)
type_test_object
.
addTypeWorkflowList
(
'
interactionworkflow_
testing_interaction_workflow'
)
type_test_object
.
addTypeWorkflowList
(
'testing_interaction_workflow'
)
type_test_object
.
addTypeWorkflowList
(
'
workflow_
testing_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
.
resetComponentTool
()
self
.
assertFalse
(
'testing_workflow'
in
self
.
getWorkflowTool
().
getChainFor
(
type_test_object
.
getId
()))
self
.
assertFalse
(
'testing_workflow'
in
self
.
getWorkflowTool
().
getChainFor
(
type_test_object
.
getId
()))
self
.
login
()
self
.
login
()
...
@@ -238,10 +242,6 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
...
@@ -238,10 +242,6 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
def
getStateFor
(
self
,
document
):
def
getStateFor
(
self
,
document
):
return
getattr
(
document
,
'getValidationState'
)()
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
):
class
TestDCWorkflow
(
TestERP5WorkflowMixin
):
"""
"""
Check DC Workflow
Check DC Workflow
...
@@ -261,12 +261,8 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
...
@@ -261,12 +261,8 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
def
getStateFor
(
self
,
document
):
def
getStateFor
(
self
,
document
):
return
self
.
wf
.
_getWorkflowStateOf
(
document
,
id_only
=
True
)
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
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestConvertedWorkflow
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestDCWorkflow
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestDCWorkflow
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestConvertedWorkflow
))
return
suite
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