Commit 098bb79b authored by Łukasz Nowak's avatar Łukasz Nowak

Cover bug of impossible re-request of destroyed instance.

parent d45cfad3
...@@ -1212,6 +1212,73 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -1212,6 +1212,73 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_request_new_with_destroyed_while_looking_for_partition_reference(self):
"""Prove that having destroyed SI allows to request new one with same
reference, when destruction was done while looking for new partition"""
self.computer_partition_amount = 0
sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + """
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
SetRandomRequestedReference
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstancePrepare
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
SlapLogout
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
CheckSoftwareInstanceNoDeliveryRelated
Logout
LoginTestVifibCustomer
RequestSoftwareInstanceDestroy
Tic
Logout
LoginDefaultUser
CheckSoftwareInstanceCancelledSaleOrderLine
Tic # in order to give chance to update Open Order
CheckOpenOrderLineRemoved
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
SlapLogout
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
CheckSoftwareInstanceOrderedSaleOrderLine
CheckSoftwareInstanceNoDeliveryRelated
Logout
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_request_new_with_destroyed_reference(self): def test_request_new_with_destroyed_reference(self):
"""Prove that having destroyed SI allows to request new one with same """Prove that having destroyed SI allows to request new one with same
reference""" reference"""
......
...@@ -128,18 +128,6 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin): ...@@ -128,18 +128,6 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def stepCheckSoftwareInstanceNoDeliveryRelated(self, sequence, **kw):
self.assertEqual(None, self.portal.portal_catalog.getResultValue(
default_aggregate_uid=sequence['software_instance_uid'],
portal_type=self.sale_packing_list_line_portal_type
))
def stepCheckSoftwareInstanceCancelledSaleOrderLine(self, sequence, **kw):
self.assertEqual('cancelled', self.portal.portal_catalog.getResultValue(
default_aggregate_uid=sequence['software_instance_uid'],
portal_type=self.sale_order_line_portal_type
).getSimulationState())
def test_person_destroy_not_instanciable_software_instance(self): def test_person_destroy_not_instanciable_software_instance(self):
"""Check that if there is no way to instantiate software instance """Check that if there is no way to instantiate software instance
on any partition person is able to destroy it""" on any partition person is able to destroy it"""
......
...@@ -177,6 +177,24 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -177,6 +177,24 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
######################################## ########################################
# Steps -- scenarios # Steps -- scenarios
######################################## ########################################
def stepCheckSoftwareInstanceNoDeliveryRelated(self, sequence, **kw):
self.assertEqual(None, self.portal.portal_catalog.getResultValue(
default_aggregate_uid=sequence['software_instance_uid'],
portal_type=self.sale_packing_list_line_portal_type
))
def stepCheckSoftwareInstanceCancelledSaleOrderLine(self, sequence, **kw):
self.assertEqual('cancelled', self.portal.portal_catalog.getResultValue(
default_aggregate_uid=sequence['software_instance_uid'],
portal_type=self.sale_order_line_portal_type
).getSimulationState())
def stepCheckSoftwareInstanceOrderedSaleOrderLine(self, sequence, **kw):
self.assertEqual('ordered', self.portal.portal_catalog.getResultValue(
default_aggregate_uid=sequence['software_instance_uid'],
portal_type=self.sale_order_line_portal_type
).getSimulationState())
def stepCheckOpenOrderLineRemoved(self, sequence, **kw): def stepCheckOpenOrderLineRemoved(self, sequence, **kw):
software_instance = self.portal.portal_catalog.getResultValue( software_instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid']) uid=sequence['software_instance_uid'])
......
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