Commit 978e06ef authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: project needed in test

parent d3a2ab6c
......@@ -23,7 +23,8 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_ComputeNode_setSubjectList(self):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
new_id = self.generateNewId()
......@@ -40,7 +41,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
self.person_user.getRelativeUrl()
def check_Instance_validate(self, portal_type):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
# Instance Tree required for security.
......@@ -49,14 +51,17 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
title="HS %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTHS-%s" % self.new_id,
destination_reference="TESTHS-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl()
destination_section=self.person_user.getRelativeUrl(),
follow_up_value=project
)
instance = self.portal.software_instance_module.newContent(
portal_type=portal_type,
title="Instance %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTINST-%s" % self.new_id,
specialise_value=hs)
specialise_value=hs,
follow_up_value=project
)
if portal_type == "Software Instance":
self._addERP5Login(instance)
......@@ -89,7 +94,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_Instance_validate("Slave Instance")
def test_SlaveInstance_requestDestroy(self):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
# Instance Tree required for security.
......@@ -98,7 +104,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
title="HS %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTHS-%s" % self.new_id,
destination_reference="TESTHS-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl()
destination_section=self.person_user.getRelativeUrl(),
follow_up_value=project
)
instance = self.portal.software_instance_module.newContent(
......@@ -107,7 +114,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
reference="TESTINST-%s" % self.new_id,
destination_reference="TESTINST-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl(),
specialise_value=hs
specialise_value=hs,
follow_up_value=project
)
request_kw = dict(
software_release='http://example.org',
......@@ -124,7 +132,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
self.assertEqual(instance.getValidationState(), 'invalidated')
def check_SoftwareInstallation_changeState(self, method_id):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
......@@ -165,7 +174,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_SoftwareInstallation_changeState('requestDestroy')
def check_SoftwareInstance_changeState(self, method_id):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
new_id = self.generateNewId()
......@@ -230,7 +240,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_SoftwareInstance_changeState("requestDestroy")
def check_change_instance_parameter(self, portal_type, method_id):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
instance = self.portal.software_instance_module.newContent(
......@@ -240,6 +251,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference="TESTINST-%s" % self.new_id,
ssl_certificate="foo",
ssl_key="bar",
follow_up_value=project
)
self.tic()
......@@ -286,7 +298,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_SoftwareInstance_setSuccessorList(self):
portal_type = "Software Instance"
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
new_id = self.generateNewId()
......@@ -297,6 +310,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference="TESTINST-%s" % new_id,
ssl_certificate="foo",
ssl_key="bar",
follow_up_value=project
)
new_id = self.generateNewId()
......@@ -308,6 +322,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
ssl_certificate="foo",
ssl_key="bar",
successor_value=instance3,
follow_up_value=project
)
new_id = self.generateNewId()
......@@ -319,6 +334,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
ssl_certificate="foo",
ssl_key="bar",
successor_value=instance2,
follow_up_value=project
)
self.tic()
......
......@@ -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>testSlapOSCloudInteractionWorkflow</string> </value>
......@@ -61,28 +55,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>
......@@ -95,7 +74,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>
......@@ -104,7 +83,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