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):
sequence_list.addSequenceString(sequence_string)
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):
"""Prove that having destroyed SI allows to request new one with same
reference
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():
suite = unittest.TestSuite()
......
......@@ -463,7 +463,8 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
person = self.portal.ERP5Site_getAuthenticatedMemberPersonValue()
software_release = self.portal.portal_catalog.getResultValue(
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:
kw['software_type'] = sequence.get('requested_software_type',
......@@ -485,9 +486,16 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
# duplication
software_instance_portal_type = kw.get("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,
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))
software_instance = software_instance_list[0]
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