Commit 75a61a17 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: add customer project assignment

parent d998fce3
......@@ -40,6 +40,13 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
function='computer/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',
......@@ -97,13 +104,14 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
public_person = self.portal.portal_catalog.getResultValue(
portal_type="ERP5 Login",
reference=public_reference).getParentValue()
self.addProjectCustomerAssignment(public_person, project)
public_instance_title = 'Public title %s' % self.generateNewId()
public_instance_type = 'public type'
self.checkInstanceAllocation(public_person.getUserId(),
public_reference, public_instance_title,
public_server_software, public_instance_type,
public_server)
public_server, project.getReference())
# turn public guy to a friend and check that he can allocate slave
......@@ -117,7 +125,8 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
# and the instances
self.checkInstanceUnallocation(public_person.getUserId(),
public_reference, public_instance_title,
public_server_software, public_instance_type, public_server)
public_server_software, public_instance_type, public_server,
project.getReference())
# and uninstall some software on them
self.logout()
......@@ -134,6 +143,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
self.stepCallSlaposRequestUpdateInstanceTreeOpenSaleOrderAlarm()
self.tic()
self.logout()
self.login()
self.assertOpenSaleOrderCoverage(public_reference)
......@@ -218,16 +228,23 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
"""
self.logout()
self.login('ERP5TypeTestCase')
# trigger the CRM interaction
self.stepCallSlaposCrmCreateRegularisationRequestAlarm()
self.tic()
self.logout()
self.login()
# check final document state
for person_reference in (owner_reference, ):
person = self.portal.portal_catalog.getResultValue(
portal_type='ERP5 Login', reference=person_reference).getParentValue()
self.assertPersonDocumentCoverage(person)
"""
def test_default_scenario(self):
# some preparation
......@@ -291,7 +308,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
self.checkInstanceAllocation(public_person.getUserId(),
public_reference, public_instance_title,
public_server_software, public_instance_type,
public_server)
public_server, 'XXX')
# join as other person and request a software instance on compute_node
# configured by owner
......@@ -336,7 +353,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
# and the instances
self.checkInstanceUnallocation(public_person.getUserId(),
public_reference, public_instance_title,
public_server_software, public_instance_type, public_server)
public_server_software, public_instance_type, public_server, 'XXX')
self.checkInstanceUnallocation(other_person.getUserId(),
other_reference, other_instance_title,
......@@ -567,7 +584,7 @@ class TestSlapOSDefaultCRMEscalation(DefaultScenarioMixin):
public_instance_type = 'public type'
public_server_software = self.generateNewSoftwareReleaseUrl()
self.requestInstance(person.getUserId(), public_instance_title,
public_server_software, public_instance_type)
public_server_software, public_instance_type, 'XXX')
# check the Open Sale Order coverage
self.stepCallSlaposRequestUpdateInstanceTreeOpenSaleOrderAlarm()
......
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