Commit 09f56b7b authored by Łukasz Nowak's avatar Łukasz Nowak

Check impact of Software Release state on request availability.

parent 2a68ce9e
......@@ -32,12 +32,16 @@ class TestVifibSlapSoftwareReleaseAvailable(TestVifibSlapWebServiceMixin):
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
CheckSoftwareReleaseUnavailableForRequest \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseAvailableCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStoppedPurchasePackingList \
CheckSoftwareReleaseAvailableForRequest \
Logout \
LoginERP5TypeTestCase \
CheckSiteConsistency \
......@@ -49,6 +53,9 @@ class TestVifibSlapSoftwareReleaseAvailable(TestVifibSlapWebServiceMixin):
def test_Computer_available_SetupResource_ConfirmedState_CleanupResource_ConfirmedState(self):
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
CheckSoftwareReleaseUnavailableForRequest \
Logout \
LoginDefaultUser \
SetCurrentPurchasePackingListAsA \
Logout \
......@@ -65,6 +72,7 @@ class TestVifibSlapSoftwareReleaseAvailable(TestVifibSlapWebServiceMixin):
Tic \
SlapLogout \
LoginDefaultUser \
CheckSoftwareReleaseAvailableForRequest \
CheckStoppedPurchasePackingListA \
CheckConfirmedPurchasePackingListB \
Logout \
......@@ -77,6 +85,7 @@ class TestVifibSlapSoftwareReleaseAvailable(TestVifibSlapWebServiceMixin):
LoginDefaultUser \
CheckDeliveredPurchasePackingListA \
CheckDeliveredPurchasePackingListB \
CheckSoftwareReleaseUnavailableForRequest \
Logout \
LoginERP5TypeTestCase \
CheckSiteConsistency \
......
......@@ -220,6 +220,19 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
slap_computer_partition.request(**kw)
def _getRequestBasedComputerPartitionCount(self, sequence):
return self.portal.portal_catalog.countResults(
portal_type='Computer Partition',
parent_uid=sequence['computer_uid'],
software_release_url=sequence['software_release_uri'],
free_for_request=1)[0][0]
def stepCheckSoftwareReleaseAvailableForRequest(self, sequence, **kw):
self.assertFalse(self._getRequestBasedComputerPartitionCount(sequence) == 0)
def stepCheckSoftwareReleaseUnavailableForRequest(self, sequence, **kw):
self.assertTrue(self._getRequestBasedComputerPartitionCount(sequence) == 0)
def stepTriggerConfirmPlannedInvoiceAlarm(self, sequence, **kw):
sm = getSecurityManager()
self.login()
......
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