Commit 9e6a8cfa authored by Jérome Perrin's avatar Jérome Perrin

testSecurity: add a mechanism to ignore some workflows in test_workflow_transition_protection

On some technical workflows, it can be OK to have some transitions
without protection
parent 5b130a47
...@@ -41,6 +41,8 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase ...@@ -41,6 +41,8 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
# return (...) # return (...)
class TestSecurityMixin(ERP5TypeTestCase): class TestSecurityMixin(ERP5TypeTestCase):
workflow_transition_protection_ignored_workflow_id_list = (
)
def _prepareDocumentList(self): def _prepareDocumentList(self):
if getattr(self, '_prepareDocumentList_finished', None): if getattr(self, '_prepareDocumentList_finished', None):
...@@ -114,6 +116,8 @@ class TestSecurityMixin(ERP5TypeTestCase): ...@@ -114,6 +116,8 @@ class TestSecurityMixin(ERP5TypeTestCase):
""" """
error_list = [] error_list = []
for wf in self.portal.portal_workflow.objectValues(): for wf in self.portal.portal_workflow.objectValues():
if wf.getId() in self.workflow_transition_protection_ignored_workflow_id_list:
continue
if wf.__class__.__name__ in ['InteractionWorkflowDefinition', 'Interaction Workflow']: if wf.__class__.__name__ in ['InteractionWorkflowDefinition', 'Interaction Workflow']:
continue continue
for transition in wf.getTransitionValueList(): for transition in wf.getTransitionValueList():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment