Commit 3b5dc2cf authored by Yusuke Muraoka's avatar Yusuke Muraoka

clean up a bit


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32259 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 28f54de4
......@@ -1148,53 +1148,60 @@ class TestWorkflow(SecurityTestCase):
self.assertEquals(sale_invoice.getSimulationState(), 'auto_planned')
# other as anonymous
self.failIfUserCanAccessDocument(self.other.getId(), sale_invoice)
self.failIfUserCanAddDocument(self.other.getId(), sale_invoice)
self.failIfUserCanDeleteDocument(self.other.getId(), sale_invoice)
self.failIfUserCanModifyDocument(self.other.getId(), sale_invoice)
self.failIfUserCanViewDocument(self.other.getId(), sale_invoice)
username = self.other.getReference()
self.failIfUserCanAccessDocument(username, sale_invoice)
self.failIfUserCanAddDocument(username, sale_invoice)
self.failIfUserCanDeleteDocument(username, sale_invoice)
self.failIfUserCanModifyDocument(username, sale_invoice)
self.failIfUserCanViewDocument(username, sale_invoice)
# assignee
self.assertUserCanAccessDocument(self.assignee.getId(), sale_invoice)
self.assertUserCanAddDocument(self.assignee.getId(), sale_invoice)
self.assertUserCanDeleteDocument(self.assignee.getId(), sale_invoice)
self.assertUserCanModifyDocument(self.assignee.getId(), sale_invoice)
self.assertUserCanViewDocument(self.assignee.getId(), sale_invoice)
username = self.assignee.getReference()
self.assertUserCanAccessDocument(username, sale_invoice)
self.assertUserCanAddDocument(username, sale_invoice)
self.assertUserCanDeleteDocument(username, sale_invoice)
self.assertUserCanModifyDocument(username, sale_invoice)
self.assertUserCanViewDocument(username, sale_invoice)
# assignor
self.assertUserCanAccessDocument(self.assignor.getId(), sale_invoice)
self.assertUserCanAddDocument(self.assignor.getId(), sale_invoice)
self.assertUserCanDeleteDocument(self.assignor.getId(), sale_invoice)
self.assertUserCanModifyDocument(self.assignor.getId(), sale_invoice)
self.assertUserCanViewDocument(self.assignor.getId(), sale_invoice)
username = self.assignor.getReference()
self.assertUserCanAccessDocument(username, sale_invoice)
self.assertUserCanAddDocument(username, sale_invoice)
self.assertUserCanDeleteDocument(username, sale_invoice)
self.assertUserCanModifyDocument(username, sale_invoice)
self.assertUserCanViewDocument(username, sale_invoice)
# associate
self.assertUserCanAccessDocument(self.associate.getId(), sale_invoice)
self.assertUserCanAddDocument(self.associate.getId(), sale_invoice)
self.assertUserCanDeleteDocument(self.associate.getId(), sale_invoice)
self.assertUserCanModifyDocument(self.associate.getId(), sale_invoice)
self.assertUserCanViewDocument(self.associate.getId(), sale_invoice)
username = self.associate.getReference()
self.assertUserCanAccessDocument(username, sale_invoice)
self.assertUserCanAddDocument(username, sale_invoice)
self.assertUserCanDeleteDocument(username, sale_invoice)
self.assertUserCanModifyDocument(username, sale_invoice)
self.assertUserCanViewDocument(username, sale_invoice)
# auditor
self.assertUserCanAccessDocument(self.auditor.getId(), sale_invoice)
self.failIfUserCanAddDocument(self.auditor.getId(), sale_invoice)
self.failIfUserCanDeleteDocument(self.auditor.getId(), sale_invoice)
self.failIfUserCanModifyDocument(self.auditor.getId(), sale_invoice)
self.assertUserCanViewDocument(self.auditor.getId(), sale_invoice)
username = self.auditor.getReference()
self.assertUserCanAccessDocument(username, sale_invoice)
self.failIfUserCanAddDocument(username, sale_invoice)
self.failIfUserCanDeleteDocument(username, sale_invoice)
self.failIfUserCanModifyDocument(username, sale_invoice)
self.assertUserCanViewDocument(username, sale_invoice)
# author
self.failIfUserCanAccessDocument(self.author.getId(), sale_invoice)
self.failIfUserCanAddDocument(self.author.getId(), sale_invoice)
self.failIfUserCanDeleteDocument(self.author.getId(), sale_invoice)
self.failIfUserCanModifyDocument(self.author.getId(), sale_invoice)
self.failIfUserCanViewDocument(self.author.getId(), sale_invoice)
username = self.author.getReference()
self.failIfUserCanAccessDocument(username, sale_invoice)
self.failIfUserCanAddDocument(username, sale_invoice)
self.failIfUserCanDeleteDocument(username, sale_invoice)
self.failIfUserCanModifyDocument(username, sale_invoice)
self.failIfUserCanViewDocument(username, sale_invoice)
# manager
self.assertUserCanAccessDocument(self.manager.getId(), sale_invoice)
self.assertUserCanAddDocument(self.manager.getId(), sale_invoice)
self.assertUserCanDeleteDocument(self.manager.getId(), sale_invoice)
self.assertUserCanModifyDocument(self.manager.getId(), sale_invoice)
self.assertUserCanViewDocument(self.manager.getId(), sale_invoice)
username = self.manager.getReference()
self.assertUserCanAccessDocument(username, sale_invoice)
self.assertUserCanAddDocument(username, sale_invoice)
self.assertUserCanDeleteDocument(username, sale_invoice)
self.assertUserCanModifyDocument(username, sale_invoice)
self.assertUserCanViewDocument(username, sale_invoice)
self.assertSameSet(('confirm_action', 'plan_action',),
[action['id'] for action in self.portal.portal_workflow.getActionsFor(sale_invoice)
......
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