Commit 226c046e authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test Software Product local roles

parent 0ea8c834
......@@ -936,14 +936,28 @@ class TestSoftwareInstanceModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, self.user_id, ['Owner'])
class TestSoftwareProduct(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
def test_default(self):
product = self.portal.software_product_module.newContent(
portal_type='Software Product')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
[self.user_id], False)
self.assertRoles(product, self.user_id, ['Owner'])
def test_Project(self):
project = self.addProject()
product = self.portal.software_product_module.newContent(
portal_type='Software Product',
follow_up_value=project)
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product, [self.user_id,
'%s_F-CUSTOMER' % project.getReference(),
'%s_F-PRODAGNT' % project.getReference(),
'%s_F-PRODMAN' % project.getReference()], False)
self.assertRoles(product, self.user_id, ['Owner'])
self.assertRoles(product, '%s_F-PRODMAN' % project.getReference(), ['Assignor'])
self.assertRoles(product, '%s_F-PRODAGNT' % project.getReference(), ['Assignee'])
self.assertRoles(product, '%s_F-CUSTOMER' % project.getReference(), ['Auditor'])
class TestSoftwareProductModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
......
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