Commit 4cee501f authored by Mame Coumba Sall's avatar Mame Coumba Sall

Add security test for task and task report in configuration test

parent 52ee84ad
......@@ -120,6 +120,8 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
stepViewAccessAddSaleOrder
stepViewAccessAddSalePackingList
stepViewAccessPurchaseOrder
stepViewAccessAddTask
stepViewAccessAddTaskReport
stepPurchasePackingList
stepWebSiteModule
stepPortalContributionsTool
......
......@@ -1790,6 +1790,46 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
self.assertUserCanViewDocument(username, order)
self.failIfUserCanModifyDocument(username, order)
def stepViewAccessAddTask(self, sequence=None, sequence_list=None, **kw):
module = self.portal.task_module
for username in self.all_username_list:
self.assertUserCanViewDocument(username, module)
self.assertUserCanAccessDocument(username, module)
for username in self.sales_and_purchase_username_list:
self.assertUserCanAddDocument(username, module)
self._loginAsUser(username)
task = module.newContent(portal_type='Task')
self.assertUserCanViewDocument(username, task)
self.failUnlessUserCanPassWorkflowTransition(
username, 'plan_action', task)
self.failUnlessUserCanPassWorkflowTransition(
username, 'confirm_action', task)
self.failUnlessUserCanPassWorkflowTransition(
username, 'cancel_action', task)
task.confirm()
self.assertEquals('confirmed', task.getSimulationState())
self.assertUserCanViewDocument(username, task)
self.failIfUserCanModifyDocument(username, task)
def stepViewAccessAddTaskReport(self, sequence=None, sequence_list=None, **kw):
module = self.portal.task_report_module
for username in self.all_username_list:
self.assertUserCanViewDocument(username, module)
self.assertUserCanAccessDocument(username, module)
for username in self.sales_and_purchase_username_list:
self.assertUserCanAddDocument(username, module)
self._loginAsUser(username)
task_report = module.newContent(portal_type='Task Report')
self.assertUserCanViewDocument(username, task_report)
self.failUnlessUserCanPassWorkflowTransition(
username, 'confirm_action', task_report)
task_report.confirm()
self.assertEquals('confirmed', task_report.getSimulationState())
self.assertUserCanViewDocument(username, task_report)
self.assertUserCanModifyDocument(username, task_report)
def stepPurchasePackingList(self, sequence=None, sequence_list=None, **kw):
module = self.portal.purchase_packing_list_module
for username in self.all_username_list:
......
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