Commit 21831a16 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test: drop test_InternalPackingListLine*

parent b52f1520
......@@ -19,7 +19,6 @@
#
##############################################################################
from erp5.component.test.testSlapOSERP5GroupRoleSecurity import TestSlapOSGroupRoleSecurityMixin
from DateTime import DateTime
class TestSlapOSLocalPermissionSlapOSInteractionWorkflow(
TestSlapOSGroupRoleSecurityMixin):
......@@ -127,191 +126,3 @@ class TestSlapOSLocalPermissionSlapOSInteractionWorkflow(
'G-COMPANY', self.person_user.getUserId()],
False)
def test_InternalPackingListLine_setAggregate_instance_tree(self):
self._makePerson()
project = self.portal.project_module.newContent(
portal_type="Project",
)
instance_tree = self.portal.instance_tree_module.newContent(
portal_type='Instance Tree',
reference='TESTHS-%s' % self.generateNewId())
internal_packing_list = self.portal.internal_packing_list_module.newContent(
portal_type='Internal Packing List')
internal_packing_list_line = internal_packing_list.newContent(
portal_type='Internal Packing List Line')
internal_packing_list.edit(source_value=self.person_user,
source_section_value=self.person_user,
source_project_value=project,
destination=self.person_user.getRelativeUrl(),
destination_section=self.person_user.getRelativeUrl(),
source_decision=self.person_user.getRelativeUrl(),
destination_decision=self.person_user.getRelativeUrl(),
destination_project_value=project,
start_date=DateTime()-1,
stop_date=DateTime()-1)
internal_packing_list.confirm()
internal_packing_list.stop()
internal_packing_list.deliver()
software_instance = self.portal.software_instance_module.newContent(
portal_type='Software Instance')
software_instance.edit(specialise=instance_tree.getRelativeUrl())
slave_instance = self.portal.software_instance_module.newContent(
portal_type='Slave Instance')
slave_instance.edit(specialise=instance_tree.getRelativeUrl())
support_request = self.portal.support_request_module.newContent(
portal_type="Support Request"
)
support_request.edit(aggregate=instance_tree.getRelativeUrl())
upgrade_decision = self.portal.upgrade_decision_module.newContent(
portal_type="Upgrade Decision"
)
upgrade_decision_line = upgrade_decision.newContent(
portal_type="Upgrade Decision Line"
)
upgrade_decision_line.edit(aggregate=instance_tree.getRelativeUrl())
self.tic()
self.assertSecurityGroup(internal_packing_list, [self.user_id,],
False)
self.assertSecurityGroup(instance_tree, [self.user_id, 'G-COMPANY',
instance_tree.getReference()],
False)
self.assertSecurityGroup(software_instance, [self.user_id, 'G-COMPANY',
instance_tree.getReference()], False)
self.assertSecurityGroup(slave_instance, [self.user_id, 'G-COMPANY',
instance_tree.getReference()], False)
self.assertSecurityGroup(support_request, [self.user_id, 'G-COMPANY'], False)
self.assertSecurityGroup(upgrade_decision, [self.user_id, 'G-COMPANY'], False)
internal_packing_list_line.edit(
#quantity_unit="unit",
resource_value=self.portal.product_module.compute_node,
price=0.0,
quantity=1.0,
aggregate_value=instance_tree)
self.tic()
self.assertSecurityGroup(internal_packing_list, [self.user_id,],
False)
self.assertSecurityGroup(instance_tree, [self.user_id, 'G-COMPANY',
project.getReference(),
instance_tree.getReference()],
False)
self.assertSecurityGroup(software_instance, [self.user_id, 'G-COMPANY',
project.getReference(),
instance_tree.getReference()], False)
self.assertSecurityGroup(slave_instance, [self.user_id, 'G-COMPANY',
project.getReference(),
instance_tree.getReference()], False)
self.assertSecurityGroup(support_request, [self.user_id, 'G-COMPANY',
project.getReference()], False)
self.assertSecurityGroup(upgrade_decision, [self.user_id, 'G-COMPANY',
project.getReference()], False)
def test_InternalPackingListLine_setAggregate_compute_node(self):
self._makePerson()
project = self.portal.project_module.newContent(
portal_type="Project",
)
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
reference='TESTCOMP-%s' % self.generateNewId())
internal_packing_list = self.portal.internal_packing_list_module.newContent(
portal_type='Internal Packing List')
internal_packing_list_line = internal_packing_list.newContent(
portal_type='Internal Packing List Line')
internal_packing_list.edit(source_value=self.person_user,
source_section_value=self.person_user,
source_project_value=project,
destination=self.person_user.getRelativeUrl(),
destination_section=self.person_user.getRelativeUrl(),
source_decision=self.person_user.getRelativeUrl(),
destination_decision=self.person_user.getRelativeUrl(),
destination_project_value=project,
start_date=DateTime()-1,
stop_date=DateTime()-1)
internal_packing_list.confirm()
internal_packing_list.stop()
internal_packing_list.deliver()
installation = self.portal.software_installation_module.newContent(
portal_type='Software Installation')
installation.edit(aggregate=compute_node.getRelativeUrl())
support_request = self.portal.support_request_module.newContent(
portal_type="Support Request"
)
support_request.edit(aggregate=compute_node.getRelativeUrl())
upgrade_decision = self.portal.upgrade_decision_module.newContent(
portal_type="Upgrade Decision"
)
upgrade_decision_line = upgrade_decision.newContent(
portal_type="Upgrade Decision Line"
)
upgrade_decision_line.edit(aggregate=compute_node.getRelativeUrl())
self.tic()
self.assertSecurityGroup(internal_packing_list, [self.user_id,],
False)
self.assertSecurityGroup(compute_node, [self.user_id, 'G-COMPANY',
compute_node.getUserId()],
False)
self.assertSecurityGroup(installation, [self.user_id, 'G-COMPANY',
compute_node.getUserId()], False)
self.assertSecurityGroup(support_request, [self.user_id, 'G-COMPANY'], False)
self.assertSecurityGroup(upgrade_decision, [self.user_id, 'G-COMPANY'], False)
internal_packing_list_line.edit(
#quantity_unit="unit",
resource_value=self.portal.product_module.compute_node,
price=0.0,
quantity=1.0,
aggregate_value=compute_node)
self.tic()
self.assertSecurityGroup(internal_packing_list, [self.user_id,],
False)
self.assertSecurityGroup(compute_node, [self.user_id, 'G-COMPANY',
project.getReference(), compute_node.getUserId()],
False)
self.assertSecurityGroup(installation, [self.user_id, 'G-COMPANY',
project.getReference(), compute_node.getUserId()], False)
self.assertSecurityGroup(support_request, [self.user_id, 'G-COMPANY',
project.getReference()], False)
self.assertSecurityGroup(upgrade_decision, [self.user_id, 'G-COMPANY',
project.getReference()], False)
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