Commit 78ca9e68 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: add customer project assignment

parent 5694a8fd
......@@ -26,6 +26,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',
......@@ -83,13 +90,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
......@@ -103,7 +111,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()
......@@ -120,6 +129,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
self.stepCallSlaposRequestUpdateInstanceTreeOpenSaleOrderAlarm()
self.tic()
self.logout()
self.login()
self.assertOpenSaleOrderCoverage(public_reference)
......@@ -204,16 +214,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
......@@ -286,7 +303,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 owner friend and request a software instance on compute_node
# configured by owner
......@@ -307,7 +324,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
friend_instance_type = 'friend_type'
self.checkInstanceAllocation(friend_person.getUserId(), friend_reference,
friend_instance_title, friend_server_software, friend_instance_type,
friend_server)
friend_server, 'XXX')
# check that friend is able to request slave instance matching the
# public's compute_node software instance
......@@ -315,7 +332,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
generateNewId()
self.checkSlaveInstanceAllocation(friend_person.getUserId(),
friend_reference, friend_slave_instance_title, public_server_software,
public_instance_type, public_server)
public_instance_type, public_server, 'XXX')
# turn public guy to a friend and check that he can allocate slave
# instance on instance provided by friend
......@@ -331,25 +348,25 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
.generateNewId()
self.checkSlaveInstanceAllocation(public_person.getUserId(),
public_reference, public_slave_instance_title, friend_server_software,
friend_instance_type, friend_server)
friend_instance_type, friend_server, 'XXX')
# now deallocate the slaves
self.checkSlaveInstanceUnallocation(public_person.getUserId(),
public_reference, public_slave_instance_title, friend_server_software,
friend_instance_type, friend_server)
friend_instance_type, friend_server, 'XXX')
self.checkSlaveInstanceUnallocation(friend_person.getUserId(),
friend_reference, friend_slave_instance_title, public_server_software,
public_instance_type, public_server)
public_instance_type, public_server, 'XXX')
# 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(friend_person.getUserId(),
friend_reference, friend_instance_title,
friend_server_software, friend_instance_type, friend_server)
friend_server_software, friend_instance_type, friend_server, 'XXX')
# and uninstall some software on them
self.logout()
......@@ -605,7 +622,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()
......
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSERP5DefaultScenario</string> </value>
......@@ -55,28 +49,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -89,7 +68,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -98,7 +77,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
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