Commit 6f3947bb authored by Gabriel Monnerat's avatar Gabriel Monnerat

reuse function to find the software instance installed on current computer partition

parent 4e62f9c5
...@@ -6350,20 +6350,13 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -6350,20 +6350,13 @@ class TestVifibSlapWebService(testVifibMixin):
self.assertUserCanAccessDocument(username, slave_instance) self.assertUserCanAccessDocument(username, slave_instance)
def stepSlapLoginSoftwareInstanceFromCurrentSoftwareInstance(self, sequence): def stepSlapLoginSoftwareInstanceFromCurrentSoftwareInstance(self, sequence):
computer_partition = self.portal.portal_catalog.getResultValue( software_instance = self._getSoftwareInstanceFromCurrentComputerPartition(
uid=sequence["computer_partition_uid"]) sequence)
sale_packing_list_line_list = self.portal.portal_catalog( self.assertNotEquals(None, software_instance)
portal_type="Sale Packing List Line",
aggregate_uid=computer_partition.getUid())
for sale_packing_list_line in sale_packing_list_line_list:
software_instance = sale_packing_list_line.getAggregateValue(
portal_type="Software Instance")
if software_instance is not None:
self.stepSlapLogout() self.stepSlapLogout()
global REMOTE_USER global REMOTE_USER
REMOTE_USER = software_instance.getReference() REMOTE_USER = software_instance.getReference()
self.login(software_instance.getReference()) self.login(software_instance.getReference())
break
def _getSoftwareInstanceFromCurrentComputerPartition(self, sequence): def _getSoftwareInstanceFromCurrentComputerPartition(self, sequence):
query = ComplexQuery( query = ComplexQuery(
......
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