diff --git a/product/ERP5/tests/testInventoryAPI.py b/product/ERP5/tests/testInventoryAPI.py index b7060b4d5c96dbad973fce3645a9054f304eced6..815520509403b9240243b8346ee378fd170fa7bb 100644 --- a/product/ERP5/tests/testInventoryAPI.py +++ b/product/ERP5/tests/testInventoryAPI.py @@ -2061,9 +2061,9 @@ class TestInventoryDocument(InventoryAPITestCase): workflow_history = self.workflow_tool.getInfoFor(ob=new_inventory, name='history', wf_id=workflow_id) workflow_error_message = str(workflow_history[-1]['error_message']) - self.assertTrue( - workflow_error_message.find('There is already an inventory')>=0, - workflow_error_message) + self.assertTrue(len(workflow_error_message)) + self.assertTrue(len([x for x in workflow_error_message \ + if x.find('There is already an inventory')])) # Add a case in order to check a bug when the other inventory at the # same date does not change stock values @@ -2081,9 +2081,9 @@ class TestInventoryDocument(InventoryAPITestCase): workflow_history = self.workflow_tool.getInfoFor(ob=new_inventory, name='history', wf_id=workflow_id) workflow_error_message = str(workflow_history[-1]['error_message']) - self.assertTrue( - workflow_error_message.find('There is already an inventory')>=0, - workflow_error_message) + self.assertTrue(len(workflow_error_message)) + self.assertTrue(len([x for x in workflow_error_message \ + if x.find('There is already an inventory')])) finally: # remove all property sheet we added to type informations ttool = self.getTypesTool()