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
iv
erp5
Commits
8abe46e4
Commit
8abe46e4
authored
Sep 05, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: add permission/roles acquisition testing
parent
ea6373d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
bt5/erp5_workflow_test/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
.../portal_components/test.erp5.testWorkflowAndDCWorkflow.py
+14
-4
No files found.
bt5/erp5_workflow_test/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
View file @
8abe46e4
...
...
@@ -262,17 +262,27 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
self
.
logMessage
(
" Verify permission roles dict on 'current' state"
)
permission_roles_dict
=
workflow
.
state_current
\
.
getStatePermissionRolesDict
()
self
.
tic
()
self
.
assertIn
(
permission
,
permission_roles_dict
)
self
.
logMessage
(
" Change roles for '"
+
permission
+
"' on state and update role list for permission
"
)
"' on state and update role list for permission"
)
permission_roles_dict
[
permission
]
=
[
'Assignor'
]
workflow
.
state_current
.
setAcquirePermissionList
([])
workflow
.
updateRoleMappingsFor
(
text_document
)
self
.
tic
()
self
.
logMessage
(
" Check document permissions/roles mapping was updated "
+
"(it should be a tuple, as there is no acquisition)"
)
self
.
assertEqual
(
getattr
(
text_document
,
permission_key
),
(
'Assignor'
,))
self
.
logMessage
(
" Configure acquisition for '"
+
permission
+
"' on state and update role list for permission"
)
workflow
.
state_current
.
setAcquirePermissionList
([
permission
])
workflow
.
updateRoleMappingsFor
(
text_document
)
self
.
tic
()
self
.
logMessage
(
" Check document permissions/roles mapping was updated"
)
self
.
logMessage
(
" Check document permissions/roles mapping is now"
+
" a list (acquisition)"
)
self
.
assertEqual
(
getattr
(
text_document
,
permission_key
),
[
'Assignor'
])
self
.
logMessage
(
" Restore original configuration"
)
...
...
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