Commit a650acb9 authored by Łukasz Nowak's avatar Łukasz Nowak

Check destroyed title can be rerequested from web UI.

parent b4f3465e
...@@ -1217,13 +1217,37 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -1217,13 +1217,37 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def stepSetSoftwareTitleRandom(self, sequence, **kw):
sequence['software_title'] = str(random.random())
def test_request_new_with_destroyed_reference_web_ui(self): def test_request_new_with_destroyed_reference_web_ui(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
Supports web UI case. Supports web UI case.
""" """
raise NotImplementedError sequence_list = SequenceList()
sequence_string = "SetSoftwareTitleRandom" + \
self.prepare_destroyed_computer_partition + \
"""
LoginTestVifibCustomer
PersonRequestSoftwareInstance
Tic
Logout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SetSelectedComputerPartition
SelectCurrentlyUsedSalePackingListUid
Logout
LoginDefaultUser
CheckComputerPartitionInstanceSetupSalePackingListConfirmed
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
...@@ -463,7 +463,8 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -463,7 +463,8 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
person = self.portal.ERP5Site_getAuthenticatedMemberPersonValue() person = self.portal.ERP5Site_getAuthenticatedMemberPersonValue()
software_release = self.portal.portal_catalog.getResultValue( software_release = self.portal.portal_catalog.getResultValue(
uid=sequence['software_release_uid']) uid=sequence['software_release_uid'])
software_title = self.id() + str(random()) software_title = sequence.get('software_title',
self.id() + str(random()))
if 'software_type' not in kw: if 'software_type' not in kw:
kw['software_type'] = sequence.get('requested_software_type', kw['software_type'] = sequence.get('requested_software_type',
...@@ -485,9 +486,16 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -485,9 +486,16 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
# duplication # duplication
software_instance_portal_type = kw.get("instance_portal_type", software_instance_portal_type = kw.get("instance_portal_type",
self.software_instance_portal_type) self.software_instance_portal_type)
software_instance_list = self.portal.portal_catalog( software_instance_list = []
cleanup_resource = self.portal.portal_preferences\
.getPreferredInstanceCleanupResource()
for software_instance in self.portal.portal_catalog(
portal_type=software_instance_portal_type, portal_type=software_instance_portal_type,
title=software_title) title=software_title):
try:
software_instance.Item_getInstancePackingListLine(cleanup_resource)
except ValueError:
software_instance_list.append(software_instance)
self.assertEqual(1, len(software_instance_list)) self.assertEqual(1, len(software_instance_list))
software_instance = software_instance_list[0] software_instance = software_instance_list[0]
sequence.edit( sequence.edit(
......
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