Commit ff772cea authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test Organisation local roles

parent 33bd5105
......@@ -1593,3 +1593,30 @@ class TestSubscriptionRequest(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(delivery, 'F-SALE*', ['Auditor'])
self.assertRoles(delivery, person.getUserId(), ['Associate'])
class TestOrganisationModule(TestSlapOSGroupRoleSecurityMixin):
def test_OrganisationModule(self):
module = self.portal.organisation_module
self.assertSecurityGroup(module,
['F-SALE*', 'F-ACCOUNTING*', 'R-SHADOW-PERSON',
module.Base_getOwnerId()], False)
self.assertRoles(module, 'F-SALE*', ['Auditor', 'Author'])
self.assertRoles(module, 'F-ACCOUNTING*', ['Auditor', 'Author'])
self.assertRoles(module, 'R-SHADOW-PERSON', ['Auditor'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
class TestOrganisation(TestSlapOSGroupRoleSecurityMixin):
def test_Organisation_default(self):
delivery = self.portal.organisation_module.newContent(
portal_type='Organisation')
self.assertSecurityGroup(delivery,
['F-ACCAGT', 'F-ACCMAN', 'F-SALEAGT', 'F-SALEMAN',
'R-SHADOW-PERSON', self.user_id], False)
self.assertRoles(delivery, self.user_id, ['Owner'])
self.assertRoles(delivery, 'F-ACCAGT', ['Assignee'])
self.assertRoles(delivery, 'F-ACCMAN', ['Assignor'])
self.assertRoles(delivery, 'F-SALEAGT', ['Assignee'])
self.assertRoles(delivery, 'F-SALEMAN', ['Assignor'])
self.assertRoles(delivery, 'R-SHADOW-PERSON', ['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