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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
46bca9e5
Commit
46bca9e5
authored
Aug 18, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix test on worklists to use new action_xxx instead of actbox_xxx
parent
3b58467c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testWorklist.py
...tTemplateItem/portal_components/test.erp5.testWorklist.py
+18
-18
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testWorklist.py
View file @
46bca9e5
...
...
@@ -13,17 +13,17 @@ class TestWorklist(testWorkflowMixin):
test_worklist_dict
=
{
'assignor_worklist'
:
{
'act
box
_name'
:
'assignor_todo'
,
'role'
:
'Assignor'
,
'expr'
:
None
,
'state'
:
'draft'
,
'int_variable'
:
None
},
{
'act
ion
_name'
:
'assignor_todo'
,
'role'
:
'Assignor'
,
'expr'
:
None
,
'state'
:
'draft'
,
'int_variable'
:
None
},
'owner_worklist'
:
{
'act
box
_name'
:
'owner_todo'
,
'role'
:
'Owner'
,
'expr'
:
None
,
'state'
:
'draft'
,
'int_variable'
:
None
},
{
'act
ion
_name'
:
'owner_todo'
,
'role'
:
'Owner'
,
'expr'
:
None
,
'state'
:
'draft'
,
'int_variable'
:
None
},
'owner_worklist_desactivated'
:
{
'act
box
_name'
:
'owner_todo_desactivated'
,
'role'
:
'Owner'
,
'expr'
:
'python: 0'
,
'state'
:
'draft'
,
'int_variable'
:
None
},
{
'act
ion
_name'
:
'owner_todo_desactivated'
,
'role'
:
'Owner'
,
'expr'
:
'python: 0'
,
'state'
:
'draft'
,
'int_variable'
:
None
},
'owner_worklist_wrong_state'
:
{
'act
box
_name'
:
'owner_todo_wrong_state'
,
'role'
:
'Owner'
,
'expr'
:
None
,
'state'
:
'not_draft'
,
'int_variable'
:
None
},
{
'act
ion
_name'
:
'owner_todo_wrong_state'
,
'role'
:
'Owner'
,
'expr'
:
None
,
'state'
:
'not_draft'
,
'int_variable'
:
None
},
'assignor_owner_worklist'
:
{
'act
box
_name'
:
'assignor_owner_todo'
,
'role'
:
'Assignor ; Owner'
,
'expr'
:
None
,
'state'
:
'draft'
,
'int_variable'
:
None
},
{
'act
ion
_name'
:
'assignor_owner_todo'
,
'role'
:
'Assignor ; Owner'
,
'expr'
:
None
,
'state'
:
'draft'
,
'int_variable'
:
None
},
'int_value_worklist'
:
{
'act
box
_name'
:
'int_value_todo'
,
'role'
:
None
,
'expr'
:
None
,
'state'
:
None
,
'int_variable'
:
str
(
1
)}
{
'act
ion
_name'
:
'int_value_todo'
,
'role'
:
None
,
'expr'
:
None
,
'state'
:
None
,
'int_variable'
:
str
(
1
)}
}
...
...
@@ -121,10 +121,10 @@ class TestWorklist(testWorkflowMixin):
else
:
self
.
createDCWorklist
(
workflow_value
,
*
args
,
**
kw
)
def
createERP5Worklist
(
self
,
workflow_value
,
worklist_id
,
act
box
_name
,
act
box_url
=
None
,
portal_type
=
None
,
validation_state
=
None
,
def
createERP5Worklist
(
self
,
workflow_value
,
worklist_id
,
act
ion
_name
,
act
ion
=
None
,
portal_type
=
None
,
validation_state
=
None
,
guard_roles
=
''
,
guard_expr
=
None
,
**
kw
):
act
box_name
=
'%s (%%(count)s)'
%
actbox
_name
act
ion_name
=
'%s (%%(count)s)'
%
action
_name
if
workflow_value
.
__class__
.
__name__
==
'Workflow'
:
if
getattr
(
workflow_value
,
worklist_id
,
None
):
workflow_value
.
manage_delObjects
([
worklist_id
])
...
...
@@ -138,9 +138,9 @@ class TestWorklist(testWorkflowMixin):
worklist_value
.
edit
(
reference
=
worklist_id
,
act
box_name
=
actbox
_name
,
act
box_url
=
actbox_url
,
act
box_category
=
'global'
,
act
ion_name
=
action
_name
,
act
ion
=
action
,
act
ion_type
=
'global'
,
matched_validation_state
=
validation_state
,
matched_portal_type_list
=
portal_type
,
guard_role_list
=
guard_roles
,
...
...
@@ -154,16 +154,16 @@ class TestWorklist(testWorkflowMixin):
if
isinstance
(
worklist_variable_value
,
str
)
and
worklist_variable_value
.
startswith
(
'python'
):
worklist_variable
.
setVariableExpression
(
worklist_variable_value
)
def
createDCWorklist
(
self
,
workflow_value
,
worklist_id
,
act
box
_name
,
act
box_url
=
None
,
**
kw
):
act
box_name
=
'%s (%%(count)s)'
%
actbox
_name
def
createDCWorklist
(
self
,
workflow_value
,
worklist_id
,
act
ion
_name
,
act
ion
=
None
,
**
kw
):
act
ion_name
=
'%s (%%(count)s)'
%
action
_name
worklists
=
workflow_value
.
worklists
if
worklists
.
_getOb
(
worklist_id
,
None
):
worklists
.
deleteWorklists
([
worklist_id
])
worklists
.
addWorklist
(
worklist_id
)
worklist_value
=
worklists
.
_getOb
(
worklist_id
)
worklist_value
.
setProperties
(
''
,
act
box_name
=
actbox_name
,
actbox_url
=
actbox_url
,
worklist_value
.
setProperties
(
''
,
act
ion_name
=
action_name
,
action
=
action
,
props
=
{
k
if
k
.
startswith
(
'guard_'
)
else
'var_match_'
+
k
:
v
for
k
,
v
in
kw
.
iteritems
()})
...
...
@@ -209,7 +209,7 @@ class TestWorklist(testWorkflowMixin):
worklist
=
self
.
test_worklist_dict
[
worklist_id
]
self
.
createWorklist
(
'validation_workflow'
,
worklist_id
,
worklist
[
'act
box
_name'
],
worklist
[
'act
ion
_name'
],
guard_roles
=
worklist
[
'role'
],
guard_expr
=
worklist
[
'expr'
],
portal_type
=
'Organisation'
,
...
...
@@ -447,7 +447,7 @@ class TestWorklist(testWorkflowMixin):
self
.
createWorklist
(
'validation_workflow'
,
'region_worklist'
,
'has_semewhere_region'
,
portal_type
=
'Organisation'
,
act
box_url
=
'organisation_module?'
\
act
ion
=
'organisation_module?'
\
'region_uid:list=%(region_uid)s&'
\
'portal_type:list=%(portal_type)s&reset:int=1'
,
region_uid
=
'python:[str(object.getPortalObject().'
\
...
...
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