Commit e9d766d3 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: drop test for Compute Partition and Software Release

parent 226c046e
......@@ -269,56 +269,6 @@ class TestComputerNetworkModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'R-SHADOW-PERSON', ['Auditor'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestComputePartition(TestSlapOSGroupRoleSecurityMixin):
def test_CustomerOfThePartition(self):
partition = self.portal.compute_node_module.newContent(
portal_type='Compute Node').newContent(portal_type='Compute Partition')
self.portal.portal_workflow._jumpToStateFor(partition, 'busy')
self.commit()
instance_customer_reference = 'TESTPERSON-%s' % self.generateNewId()
slave_customer_reference = 'TESTPERSON-%s' % self.generateNewId()
instance_customer = self.portal.person_module.newContent(
portal_type='Person', reference=instance_customer_reference)
slave_customer = self.portal.person_module.newContent(
portal_type='Person', reference=slave_customer_reference)
instance_subscription_reference = 'TESTHS-%s' % self.generateNewId()
instance_subscription = self.portal.instance_tree_module\
.template_instance_tree.Base_createCloneDocument(batch_mode=1)
instance_subscription.edit(
destination_section=instance_customer.getRelativeUrl(),
reference=instance_subscription_reference)
instance = self.portal.software_instance_module.template_software_instance\
.Base_createCloneDocument(batch_mode=1)
instance.edit(specialise=instance_subscription.getRelativeUrl(),
aggregate=partition.getRelativeUrl())
instance.validate()
self.commit()
slave_subscription = self.portal.instance_tree_module\
.template_instance_tree.Base_createCloneDocument(batch_mode=1)
slave_subscription.edit(
destination_section=slave_customer.getRelativeUrl())
slave = self.portal.software_instance_module.template_slave_instance\
.Base_createCloneDocument(batch_mode=1)
slave.validate()
slave.edit(specialise=slave_subscription.getRelativeUrl(),
aggregate=partition.getRelativeUrl())
self.commit()
partition.updateLocalRolesOnSecurityGroups()
self.tic()
self.assertSecurityGroup(partition,
[self.user_id, instance_customer.getUserId(), slave_customer.getUserId(),
instance_subscription_reference], True)
self.assertRoles(partition, instance_customer.getUserId(), ['Auditor'])
self.assertRoles(partition, slave_customer.getUserId(), ['Auditor'])
self.assertRoles(partition, instance_subscription_reference, ['Auditor'])
self.assertRoles(partition, self.user_id, ['Owner'])
test_SoftwareInstanceGroupRelatedToComputePartition = \
test_CustomerOfThePartition
class TestCredentialUpdateModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
......@@ -969,25 +919,6 @@ class TestSoftwareProductModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'F-PRODUCTION*', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestSoftwareRelease(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
release = self.portal.software_release_module.newContent(
portal_type='Software Release')
release.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(release,
['G-COMPANY', self.user_id], False)
self.assertRoles(release, 'G-COMPANY', ['Assignor'])
self.assertRoles(release, self.user_id, ['Owner'])
class TestSoftwareReleaseModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.software_release_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', 'R-MEMBER', self.user_id], False)
self.assertRoles(module, 'R-MEMBER', ['Auditor', 'Author'])
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestOpenSaleOrderModule(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