Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
5c7b6d97
Commit
5c7b6d97
authored
May 15, 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: fix incorrect action ids in live test.
parent
b0d9c05c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
bt5/erp5_workflow_test_data/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
.../portal_components/test.erp5.testWorkflowAndDCWorkflow.py
+14
-14
No files found.
bt5/erp5_workflow_test_data/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
View file @
5c7b6d97
...
...
@@ -59,7 +59,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
def
test_01_testAfterScript
(
self
):
new_object
=
self
.
getTestObject
()
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
# self.assertEqual(new_object.getDescription(), "After script was executed.")
### zwj: mechanism: validate => validate interaction =>
### setTitle => setTitle interaction => setDescription
...
...
@@ -67,15 +67,15 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
def
test_02_testBeforeScript
(
self
):
new_object
=
self
.
getTestObject
()
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"invalidate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
self
.
doActionFor
(
new_object
,
"invalidate
_action
"
)
self
.
assertEqual
(
new_object
.
getDescription
(),
"Before script was executed."
)
def
test_03_testChangeOfState
(
self
):
new_object
=
self
.
getTestObject
()
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
self
.
assertEqual
(
self
.
getStateFor
(
new_object
),
'validated'
)
self
.
doActionFor
(
new_object
,
"invalidate"
)
self
.
doActionFor
(
new_object
,
"invalidate
_action
"
)
self
.
assertEqual
(
self
.
getStateFor
(
new_object
),
'invalidated'
)
def
test_04_testDoWorkflowMethodTransition
(
self
):
...
...
@@ -93,7 +93,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
are available
"""
new_object
=
self
.
getTestObject
()
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
history_list
=
new_object
.
workflow_history
[
"testing_workflow"
]
# 3 history lines are expected : draft->validation_action->validate
self
.
assertEqual
(
3
,
len
(
history_list
))
...
...
@@ -105,7 +105,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
new_object
=
self
.
getTestObject
()
self
.
assertEqual
(
new_object
.
_View_Permission
,
(
'Assignee'
,
'Assignor'
,
'Associate'
,
'Auditor'
,
'Author'
,
'Manager'
,
'Owner'
))
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
self
.
assertEqual
(
new_object
.
_View_Permission
,
(
'Assignee'
,
'Assignor'
,
'Associate'
,
'Auditor'
,
'Manager'
))
...
...
@@ -116,7 +116,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
new_object
=
self
.
getTestObject
()
exception_raised
=
False
try
:
self
.
doActionFor
(
new_object
,
"fail"
)
self
.
doActionFor
(
new_object
,
"fail
_action
"
)
except
ValidationFailed
:
exception_raised
=
True
self
.
assertEqual
(
True
,
exception_raised
)
...
...
@@ -135,7 +135,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
self
.
assertEqual
(
expected_dict
[
key
],
action
.
get
(
key
))
checkExpectedDict
({
"category"
:
"workflow"
,
"name"
:
"Validate"
},
action
)
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
action_list
=
self
.
getWorkflowTool
().
listActions
(
object
=
new_object
)
self
.
assertEqual
(
1
,
len
(
action_list
))
action
=
action_list
[
0
]
...
...
@@ -148,7 +148,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
working fine
"""
new_object
=
self
.
getTestObject
()
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
item_list
=
new_object
.
Base_getWorkflowHistoryItemList
(
"testing_workflow"
,
display
=
0
)
self
.
assertEqual
(
3
,
len
(
item_list
))
def
checkLine
(
expected_data
,
index
):
...
...
@@ -180,7 +180,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
"""
new_object
=
self
.
getTestObject
()
new_object
.
setTitle
(
'nana'
)
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
self
.
assertEqual
(
new_object
.
getTitle
(),
"toto"
)
self
.
assertEqual
(
self
.
getStateFor
(
new_object
),
'validated'
)
new_object
.
setTitle
(
"tictic"
)
...
...
@@ -191,7 +191,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
self
.
portal
=
self
.
getPortal
()
workflow_tool
=
self
.
portal
.
portal_workflow
self
.
assertEqual
(
workflow_tool
.
isTransitionPossible
(
new_object
,
'invalidate'
),
0
)
self
.
doActionFor
(
new_object
,
"validate"
)
self
.
doActionFor
(
new_object
,
"validate
_action
"
)
self
.
assertEqual
(
self
.
getStateFor
(
new_object
),
'validated'
)
self
.
assertEqual
(
workflow_tool
.
isTransitionPossible
(
new_object
,
'invalidate'
),
1
)
...
...
@@ -230,7 +230,7 @@ class TestERP5Workflow(TestERP5WorkflowMixin):
return
getattr
(
document
,
'getValidationState'
)()
def
doActionFor
(
self
,
document
,
action
):
user_action
=
action
+
'_action'
user_action
=
'transition_'
+
action
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
'workflow_testing_workflow'
)
class
TestDCWorkflow
(
TestERP5WorkflowMixin
):
...
...
@@ -253,7 +253,7 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
return
self
.
wf
.
_getWorkflowStateOf
(
document
,
id_only
=
True
)
def
doActionFor
(
self
,
document
,
action
):
user_action
=
action
+
'_action'
user_action
=
action
self
.
portal
.
portal_workflow
.
doActionFor
(
document
,
user_action
,
wf_id
=
'testing_workflow'
)
def
test_suite
():
...
...
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