Commit c27a7ac5 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: project needed in test

parent 9901d558
...@@ -31,6 +31,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -31,6 +31,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
portal = self.getPortalObject() portal = self.getPortalObject()
new_id = self.generateNewId() new_id = self.generateNewId()
self.project = self.addProject()
self.request_kw = dict( self.request_kw = dict(
software_release=self.generateNewSoftwareReleaseUrl(), software_release=self.generateNewSoftwareReleaseUrl(),
...@@ -39,7 +40,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -39,7 +40,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
instance_xml=self.generateSafeXml(), instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(), sla_xml=self.generateSafeXml(),
shared=False, shared=False,
state="started" state="started",
project_reference=self.project.getReference()
) )
# prepare part of tree # prepare part of tree
...@@ -56,7 +58,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -56,7 +58,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
text_content=self.request_kw['instance_xml'], text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'], sla_xml=self.request_kw['sla_xml'],
root_slave=self.request_kw['shared'], root_slave=self.request_kw['shared'],
successor=self.software_instance.getRelativeUrl() successor=self.software_instance.getRelativeUrl(),
follow_up_value=self.project
) )
instance_tree.validate() instance_tree.validate()
self.portal.portal_workflow._jumpToStateFor(instance_tree, 'start_requested') self.portal.portal_workflow._jumpToStateFor(instance_tree, 'start_requested')
...@@ -68,7 +71,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -68,7 +71,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
source_reference=self.request_kw['software_type'], source_reference=self.request_kw['software_type'],
text_content=self.request_kw['instance_xml'], text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'], sla_xml=self.request_kw['sla_xml'],
specialise=instance_tree.getRelativeUrl() specialise=instance_tree.getRelativeUrl(),
follow_up_value=self.project
) )
self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested') self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested')
self.software_instance.validate() self.software_instance.validate()
...@@ -870,6 +874,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -870,6 +874,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
portal = self.getPortalObject() portal = self.getPortalObject()
new_id = self.generateNewId() new_id = self.generateNewId()
self.project = self.addProject()
self.request_kw = dict( self.request_kw = dict(
software_release=self.generateNewSoftwareReleaseUrl(), software_release=self.generateNewSoftwareReleaseUrl(),
...@@ -878,7 +883,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -878,7 +883,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
instance_xml=self.generateSafeXml(), instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(), sla_xml=self.generateSafeXml(),
shared=False, shared=False,
state="started" state="started",
project_reference=self.project.getReference()
) )
# prepare part of tree # prepare part of tree
...@@ -895,7 +901,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -895,7 +901,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
text_content=self.request_kw['instance_xml'], text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'], sla_xml=self.request_kw['sla_xml'],
root_slave=self.request_kw['shared'], root_slave=self.request_kw['shared'],
successor=self.software_instance.getRelativeUrl() successor=self.software_instance.getRelativeUrl(),
follow_up_value=self.project
) )
self.instance_tree.validate() self.instance_tree.validate()
self.portal.portal_workflow._jumpToStateFor(self.instance_tree, 'start_requested') self.portal.portal_workflow._jumpToStateFor(self.instance_tree, 'start_requested')
...@@ -907,13 +914,14 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -907,13 +914,14 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
source_reference=self.request_kw['software_type'], source_reference=self.request_kw['software_type'],
text_content=self.request_kw['instance_xml'], text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'], sla_xml=self.request_kw['sla_xml'],
specialise=self.instance_tree.getRelativeUrl() specialise=self.instance_tree.getRelativeUrl(),
follow_up_value=self.project
) )
self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested') self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested')
self.software_instance.validate() self.software_instance.validate()
self.tic() self.tic()
person_user = self.makePerson() person_user = self.makePerson(self.project)
self.tic() self.tic()
# Login as new user # Login as new user
...@@ -956,7 +964,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -956,7 +964,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
destination_project=None) destination_project=None)
self.login() self.login()
other_user = self.makePerson(user=1) other_user = self.makePerson(self.project, user=1)
self.assertEqual(1 , len(other_user.objectValues(portal_type="ERP5 Login"))) self.assertEqual(1 , len(other_user.objectValues(portal_type="ERP5 Login")))
self.instance_tree.setDestinationSectionValue(destination_section) self.instance_tree.setDestinationSectionValue(destination_section)
......
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