Commit 48c449bb authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test project local roles

parent dcdf9533
...@@ -1325,3 +1325,34 @@ class TestSaleSupply(TestSlapOSGroupRoleSecurityMixin): ...@@ -1325,3 +1325,34 @@ class TestSaleSupply(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(supply, 'F-SALEAGT', ['Assignee']) self.assertRoles(supply, 'F-SALEAGT', ['Assignee'])
self.assertRoles(supply, 'F-SALEMAN', ['Assignor']) self.assertRoles(supply, 'F-SALEMAN', ['Assignor'])
class TestProjectModule(TestSlapOSGroupRoleSecurityMixin):
def test_ProjectModule(self):
module = self.portal.project_module
self.assertSecurityGroup(module,
['F-SALE*', 'F-ACCOUNTING*', 'F-PRODUCTION*', 'F-CUSTOMER',
'R-INSTANCE', 'R-COMPUTER', module.Base_getOwnerId()], True)
self.assertRoles(module, 'F-SALE*', ['Auditor', 'Author'])
self.assertRoles(module, 'F-CUSTOMER', ['Auditor'])
self.assertRoles(module, 'F-ACCOUNTING*', ['Auditor'])
self.assertRoles(module, 'F-PRODUCTION*', ['Auditor'])
self.assertRoles(module, 'F-CUSTOMER', ['Auditor'])
self.assertRoles(module, 'R-INSTANCE', ['Auditor'])
self.assertRoles(module, 'R-COMPUTER', ['Auditor'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
class TestProject(TestSlapOSGroupRoleSecurityMixin):
def test_Project_default(self):
project = self.portal.project_module.newContent(
portal_type='Project')
self.tic()
self.assertSecurityGroup(project,
['F-SALEAGT', 'F-SALEMAN', 'F-ACCOUNTING*',
project.getReference(), self.user_id], False)
self.assertRoles(project, self.user_id, ['Owner'])
self.assertRoles(project, 'F-SALEAGT', ['Assignee'])
self.assertRoles(project, 'F-SALEMAN', ['Assignor'])
self.assertRoles(project, 'F-ACCOUNTING*', ['Auditor'])
self.assertRoles(project, project.getReference(), ['Auditor'])
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