Commit 15803b60 authored by Romain Courteaud's avatar Romain Courteaud

Requesting destroyed hosting subscription does not return any document.

parent 0f92538f
...@@ -214,7 +214,7 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase): ...@@ -214,7 +214,7 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
state="destroyed", state="destroyed",
) )
hosting_subscription = person.REQUEST.get('request_hosting_subscription') hosting_subscription = person.REQUEST.get('request_hosting_subscription')
self.assertEquals("destroy_requested", hosting_subscription.getSlapState()) self.assertEquals(None, hosting_subscription)
def test_Person_requestSoftwareInstance_returnHostingSubscriptionUrl(self): def test_Person_requestSoftwareInstance_returnHostingSubscriptionUrl(self):
person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue() person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
...@@ -497,7 +497,7 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase): ...@@ -497,7 +497,7 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
self.assertEquals("stop_requested", hosting_subscription2.getSlapState()) self.assertEquals("stop_requested", hosting_subscription2.getSlapState())
self.assertEquals("validated", hosting_subscription2.getValidationState()) self.assertEquals("validated", hosting_subscription2.getValidationState())
def test_Person_requestSoftwareInstance_noConflictWithDeletedHostingSubscription(self): def test_Person_requestSoftwareInstance_deletedHostingSubscription(self):
person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue() person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
software_release = self.software_release.getUrlString() software_release = self.software_release.getUrlString()
...@@ -510,6 +510,19 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase): ...@@ -510,6 +510,19 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
sla_xml = "test" sla_xml = "test"
shared = True shared = True
person.requestSoftwareInstance(
software_release=software_release,
software_title=software_title,
software_type=software_type,
instance_xml=instance_xml,
sla_xml=sla_xml,
shared=shared,
state="stopped",
)
hosting_subscription = person.REQUEST.get('request_hosting_subscription')
transaction.commit()
self.tic()
person.requestSoftwareInstance( person.requestSoftwareInstance(
software_release=software_release, software_release=software_release,
software_title=software_title, software_title=software_title,
...@@ -519,7 +532,44 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase): ...@@ -519,7 +532,44 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
shared=shared, shared=shared,
state="destroyed", state="destroyed",
) )
hosting_subscription2 = person.REQUEST.get('request_hosting_subscription')
self.assertEquals(None, hosting_subscription2)
self.assertEquals("destroy_requested", hosting_subscription.getSlapState())
def test_Person_requestSoftwareInstance_noConflictWithDeletedHostingSubscription(self):
person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
software_release = self.software_release.getUrlString()
software_title = "test"
software_type = "test"
instance_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml = "test"
shared = True
person.requestSoftwareInstance(
software_release=software_release,
software_title=software_title,
software_type=software_type,
instance_xml=instance_xml,
sla_xml=sla_xml,
shared=shared,
state="stopped",
)
hosting_subscription = person.REQUEST.get('request_hosting_subscription') hosting_subscription = person.REQUEST.get('request_hosting_subscription')
transaction.commit()
self.tic()
person.requestSoftwareInstance(
software_release=software_release,
software_title=software_title,
software_type=software_type,
instance_xml=instance_xml,
sla_xml=sla_xml,
shared=shared,
state="destroyed",
)
self.assertEquals("destroy_requested", hosting_subscription.getSlapState()) self.assertEquals("destroy_requested", hosting_subscription.getSlapState())
transaction.commit() transaction.commit()
self.tic() self.tic()
...@@ -534,6 +584,6 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase): ...@@ -534,6 +584,6 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
state="started", state="started",
) )
hosting_subscription2 = person.REQUEST.get('request_hosting_subscription') hosting_subscription2 = person.REQUEST.get('request_hosting_subscription')
self.assertEquals("started", hosting_subscription2.getSlapState()) self.assertEquals("start_requested", hosting_subscription2.getSlapState())
self.assertNotEquals(hosting_subscription.getRelativeUrl(), self.assertNotEquals(hosting_subscription.getRelativeUrl(),
hosting_subscription2.getRelativeUrl()) hosting_subscription2.getRelativeUrl())
5 6
\ No newline at end of file \ No newline at end of file
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