Commit d01bc043 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: move tests to virtual master design

parent 7c6f1a73
...@@ -10,36 +10,6 @@ from erp5.component.test.SlapOSTestCaseDefaultScenarioMixin import DefaultScenar ...@@ -10,36 +10,6 @@ from erp5.component.test.SlapOSTestCaseDefaultScenarioMixin import DefaultScenar
class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
"""
def addSlapOSAdministratorAssignment(self, person):
person.newContent(
portal_type='Assignment',
# XXX should be project/function instead
group='company'
).open()
"""
def addProjectProductionManagerAssignment(self, person, project):
person.newContent(
portal_type='Assignment',
destination_project_value=project,
function='production/manager'
).open()
def addProjectCustomerAssignment(self, person, project):
person.newContent(
portal_type='Assignment',
destination_project_value=project,
function='customer'
).open()
def addProject(self):
project = self.portal.project_module.newContent(
portal_type='Project',
title='project-%s' % self.generateNewId()
)
project.validate()
return project
def requestRemoteNode(self, project, remote_project, remote_person): def requestRemoteNode(self, project, remote_project, remote_person):
remote_node = self.portal.compute_node_module.newContent( remote_node = self.portal.compute_node_module.newContent(
portal_type='Remote Node', portal_type='Remote Node',
...@@ -100,51 +70,6 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -100,51 +70,6 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
software_product.validate() software_product.validate()
return software_product, release_variation, type_variation return software_product, release_variation, type_variation
def addAllocationSupply(self, title, node, software_product,
software_release, software_type,
destination_value=None,
is_slave_on_same_instance_tree_allocable=False):
allocation_supply = self.portal.allocation_supply_module.newContent(
portal_type="Allocation Supply",
title=title,
aggregate_value=node,
destination_value=destination_value,
destination_project_value=software_product.getFollowUpValue(),
slave_on_same_instance_tree_allocable=is_slave_on_same_instance_tree_allocable
)
resource_vcl = [
'software_release/%s' % software_release.getRelativeUrl(),
'software_type/%s' % software_type.getRelativeUrl()
]
resource_vcl.sort()
allocation_supply_line = allocation_supply.newContent(
portal_type="Allocation Supply Line",
resource_value=software_product,
)
allocation_supply_line.edit(
p_variation_base_category_list=allocation_supply_line.getVariationRangeBaseCategoryList()
)
base_id = 'path'
allocation_supply_line.setCellRange(
base_id=base_id,
*allocation_supply_line.SupplyLine_asCellRange(base_id=base_id)
)
#cell_key = list(allocation_supply_line.getCellKeyList(base_id=base_id))[0]
cell_key = resource_vcl
allocation_supply_line.log(resource_vcl, cell_key)
allocation_supply_cell = allocation_supply_line.newCell(
base_id=base_id,
portal_type='Allocation Supply Cell',
*cell_key
)
allocation_supply_cell.edit(
mapped_value_property_list=['allocable'],
allocable=True,
predicate_category_list=cell_key,
variation_category_list=cell_key
)
allocation_supply.validate()
return allocation_supply
def stepcheckERP5Consistency(self): def stepcheckERP5Consistency(self):
not_consistent_document = self.portal.portal_catalog.getResultValue( not_consistent_document = self.portal.portal_catalog.getResultValue(
......
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