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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
e67a0908
Commit
e67a0908
authored
Jun 03, 2024
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core_test: add a test for unconfigured Workflow State permissions.
parent
16882293
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
...plateItem/portal_components/test.erp5.testERP5Workflow.py
+41
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
View file @
e67a0908
...
...
@@ -148,6 +148,47 @@ class TestERP5Workflow(ERP5TypeTestCase):
self
.
assertEqual
(
workflow
.
getCurrentStatusDict
(
doc
)[
'variable1'
],
None
)
def
test_WorkflowVariables
(
self
):
workflow
=
self
.
workflow_module
.
newContent
(
portal_type
=
'Workflow'
,
)
workflow
.
setReference
(
'wf'
)
permission_list
=
[
'Access contents information'
,
'Modify portal content'
,
'View'
,
]
workflow
.
setWorkflowManagedPermissionList
(
permission_list
)
state1
=
workflow
.
newContent
(
portal_type
=
'Workflow State'
,
title
=
'State 1'
)
state1
.
setReference
(
'state1'
)
workflow
.
setSourceValue
(
state1
)
self
.
assertEqual
(
state1
.
getAcquirePermissionList
(),
permission_list
,
)
self
.
assertEqual
(
state1
.
getStatePermissionRoleListDict
(),
{
k
:
()
for
k
in
permission_list
},
)
state1
.
setStatePermissionRoleListDict
(
{
k
:
[
'Assignor'
,
'Manager'
]
for
k
in
permission_list
},
)
workflow
.
setWorkflowManagedPermissionList
(
permission_list
+
[
'Delete objects'
]
)
self
.
assertEqual
(
state1
.
getStatePermissionRoleListDict
(),
{
'Access contents information'
:
(
'Assignor'
,
'Manager'
),
'Delete objects'
:
(),
'Modify portal content'
:
(
'Assignor'
,
'Manager'
),
'View'
:
(
'Assignor'
,
'Manager'
),
},
)
def
test_afterScript
(
self
):
workflow
=
self
.
workflow_module
.
newContent
(
...
...
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