diff --git a/master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py b/master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py index 7c35b9982187b6cbc19467482f8f947226b9335b..cbf8cc3d5460916f553980c3983e1676aa2b6ae0 100644 --- a/master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py +++ b/master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py @@ -1134,6 +1134,40 @@ class TestSlapOSPDMSkins(SlapOSTestCaseMixin): up_decision = hosting_subscription.HostingSubscription_createUpgradeDecision() self.assertEqual(up_decision, None) + def testHostingSubscription_createUpgradeDecision_create_once(self): + person = self._makePerson() + computer = self._makeComputer(allocation_scope="open/personal") + computer.edit(source_administration_value=person) + self._makeComputerPartitions(computer) + software_product = self._makeSoftwareProduct() + software_release = self._requestSoftwareRelease( + software_product.getRelativeUrl()) + url_string = software_release.getUrlString() + + self._makeSoftwareInstallation( computer, url_string) + + # Create Hosting Subscription and Software Instance + hosting_subscription = self._makeFullHostingSubscription( + url_string, person) + self._makeFullSoftwareInstance(hosting_subscription, url_string) + self._markComputerPartitionBusy(computer, + hosting_subscription.getPredecessorValue()) + + # Install the Newest software release + software_release2 = self._requestSoftwareRelease( + software_product.getRelativeUrl()) + self._makeSoftwareInstallation(computer, + software_release2.getUrlString()) + self.tic() + + up_decision = hosting_subscription.HostingSubscription_createUpgradeDecision() + self.assertNotEqual(up_decision, None) + self.assertEqual(up_decision.getSimulationState(), 'planned') + # call a second time without tic + up_decision = hosting_subscription.HostingSubscription_createUpgradeDecision() + # no new Upgrade decision created + self.assertEqual(up_decision, None) + def testHostingSubscription_createUpgradeDecision(self): person = self._makePerson() computer = self._makeComputer()