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
140
Merge Requests
140
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
546b35cc
Commit
546b35cc
authored
Jun 03, 2024
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! erp5_core_test: add a test for unconfigured Workflow State permissions.
parent
e67a0908
Pipeline
#34998
failed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
20 deletions
+22
-20
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBase.py
.../TestTemplateItem/portal_components/test.erp5.testBase.py
+0
-1
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
...plateItem/portal_components/test.erp5.testERP5Workflow.py
+1
-1
bt5/erp5_workflow_test/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
.../portal_components/test.erp5.testWorkflowAndDCWorkflow.py
+21
-18
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBase.py
View file @
546b35cc
...
...
@@ -993,7 +993,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
user
=
getSecurityManager
().
getUser
()
try
:
self
.
assertTrue
(
permission_list
)
self
.
assertFalse
(
dummy_simulation_workflow
[
'state_draft'
].
getStatePermissionRoleListDict
())
#1
obj
=
module
.
newContent
(
portal_type
=
portal_type
)
#No role is defined by default on workflow
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
View file @
546b35cc
...
...
@@ -148,7 +148,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
self
.
assertEqual
(
workflow
.
getCurrentStatusDict
(
doc
)[
'variable1'
],
None
)
def
test_Workflow
Variable
s
(
self
):
def
test_Workflow
Permission
s
(
self
):
workflow
=
self
.
workflow_module
.
newContent
(
portal_type
=
'Workflow'
,
)
...
...
bt5/erp5_workflow_test/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
View file @
546b35cc
...
...
@@ -294,10 +294,6 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
workflow
.
updateRoleMappingsFor
(
text_document
)
self
.
assertEqual
(
getattr
(
text_document
,
permission_key
),
[
'Assignor'
,
'Auditor'
])
# remove permission from the workflow, it should be removed from state
workflow
.
setWorkflowManagedPermissionList
([])
self
.
assertEqual
(
workflow
.
state_current
.
getAcquirePermissionList
(),
[])
# check the permissions are saved sorted in a canonical form: sorted and as
# tuple
workflow
.
state_current
.
setPermission
(
permission
,
[
'Auditor'
,
'Assignor'
])
...
...
@@ -305,6 +301,10 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
workflow
.
state_current
.
getStatePermissionRoleListDict
().
get
(
permission
),
(
'Assignor'
,
'Auditor'
))
# remove permission from the workflow, it should be removed from state
workflow
.
setWorkflowManagedPermissionList
([])
self
.
assertEqual
(
workflow
.
state_current
.
getAcquirePermissionList
(),
[])
def
test_14_multiple_workflow_different_permission_roles
(
self
):
workflow1
=
self
.
createERP5Workflow
(
'edit_workflow'
,
'temporary_workflow1'
)
workflow2
=
self
.
createERP5Workflow
(
'edit_workflow'
,
'temporary_workflow2'
)
...
...
@@ -395,9 +395,8 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
# create document
text_document1
=
self
.
getTestObject
()
text_document1_permission
=
getattr
(
text_document1
,
permission_key
,
None
)
# self.assertEqual(getattr(text_document1, permission_key),
# ['Assignee', 'Assignor', 'Auditor', 'Author'])
self
.
assertEqual
(
text_document1_permission
,
(
'Assignor'
,
'Assignee'
,
'Auditor'
,
'Author'
))
# add the second workflow
text_portal_type
.
setTypeWorkflowList
([
'temporary_dc_workflow1'
,
'temporary_dc_workflow2'
])
...
...
@@ -405,9 +404,7 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
# create document
text_document2
=
self
.
getTestObject
()
text_document2_permission
=
getattr
(
text_document2
,
permission_key
,
None
)
# self.assertEqual(getattr(text_document2, permission_key),
# ['Assignee', 'Assignor', 'Auditor', 'Author'])
self
.
assertEqual
(
text_document2_permission
,
None
)
# migrate workflows
self
.
portal
.
portal_workflow
.
WorkflowTool_convertWorkflow
(
...
...
@@ -416,15 +413,21 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
)
self
.
tic
()
# create another document
text_document3
=
self
.
getTestObject
()
text_document3_permission
=
getattr
(
text_document3
,
permission_key
,
None
)
# with only one workflow
text_portal_type
.
setTypeWorkflowList
([
'temporary_dc_workflow1'
])
print
(
'text_document1_permission: %r'
%
(
text_document1_permission
,
))
print
(
'text_document2_permission: %r'
%
(
text_document2_permission
,
))
print
(
'text_document3_permission: %r'
%
(
text_document3_permission
,
))
self
.
assertEqual
(
tuple
(
getattr
(
text_document3
,
permission_key
)),
(
'Assignee'
,
'Assignor'
,
'Auditor'
,
'Author'
))
# create document
text_document1a
=
self
.
getTestObject
()
text_document1a_permission
=
getattr
(
text_document1a
,
permission_key
,
None
)
self
.
assertSameSet
(
text_document1a_permission
,
text_document1_permission
)
# add the second workflow
text_portal_type
.
setTypeWorkflowList
([
'temporary_dc_workflow1'
,
'temporary_dc_workflow2'
])
# create document
text_document2a
=
self
.
getTestObject
()
text_document2a_permission
=
getattr
(
text_document2a
,
permission_key
,
None
)
self
.
assertEqual
(
text_document2a_permission
,
text_document2_permission
)
def
test_16_testWorklistViewIsAccessible
(
self
):
# check worklist view is available on workflow
...
...
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