Commit 092895d9 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Replace failUnless() calls by assertTrue().

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31797 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f220b9e9
......@@ -622,7 +622,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin):
# do the workflow transition "deliver_action"
message = self.assertWorkflowTransitionFails(self.cash_balance_regulation,
'cash_balance_regulation_workflow','deliver_action')
self.failUnless(message.find('local emission letter')>=0)
self.assertTrue(message.find('local emission letter')>=0)
def stepCheckFinalInventory(self, sequence=None, sequence_list=None, check_source=1,**kwd):
"""
......
......@@ -487,7 +487,7 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin):
def stepDeliverFails(self, sequence=None, sequence_list=None, **kwd):
message = self.assertWorkflowTransitionFails(self.cash_exchange,
'cash_exchange_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
......
......@@ -621,7 +621,7 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.cash_movement,
'cash_movement_workflow','start_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
def test_01_ERP5BankingCashMovement(self, quiet=QUIET, run=RUN_ALL_TEST):
......
......@@ -244,7 +244,7 @@ class TestERP5BankingCashMovementNewNotEmitted(TestERP5BankingMonetaryReceptionM
self.assertEqual(self.container_1.getCashNumberRangeStop(), '100')
self.assertEqual(len(self.container_1.getAggregateValueList()), 1)
self.assertEqual(self.container_1.getAggregateValueList()[0], self.cash_container_item_1)
# self.failUnless(self.container_1.getAggregateValueList()[0] == self.cash_container_item_1 or self.container_1.getAggregateValueList()[0] == self.cash_container_item_2)
# self.assertTrue(self.container_1.getAggregateValueList()[0] == self.cash_container_item_1 or self.container_1.getAggregateValueList()[0] == self.cash_container_item_2)
self.assertEqual(len(self.container_1.objectIds()), 1)
# now get the line and check it
self.container_line_1 = self.container_1.objectValues()[0]
......@@ -281,7 +281,7 @@ class TestERP5BankingCashMovementNewNotEmitted(TestERP5BankingMonetaryReceptionM
self.assertEqual(self.container_2.getCashNumberRangeStop(), '200')
self.assertEqual(len(self.container_2.getAggregateValueList()), 1)
self.assertEqual(self.container_2.getAggregateValueList()[0], self.cash_container_item_2)
# self.failUnless(self.container_2.getAggregateValueList()[0] == self.cash_container_item_2 or self.container_2.getAggregateValueList()[0] == self.cash_container_item_1)
# self.assertTrue(self.container_2.getAggregateValueList()[0] == self.cash_container_item_2 or self.container_2.getAggregateValueList()[0] == self.cash_container_item_1)
self.assertEqual(len(self.container_2.objectIds()), 1)
# now get the line and check it
self.container_line_2 = self.container_2.objectValues()[0]
......
......@@ -530,7 +530,7 @@ class TestERP5BankingCashSorting(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.cash_sorting,
'cash_sorting_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
......@@ -400,7 +400,7 @@ class TestERP5BankingCashToCurrencySale(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.cash_to_currency_sale,
'cash_to_currency_sale_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
......@@ -285,7 +285,7 @@ class TestERP5BankingCheckPaymentMixin(TestERP5BankingMixin):
'check_payment_workflow','plan_action')
LOG('self.assertWorkflowTransitionFails message',0,message)
if insuffisient_balance:
self.failUnless(message.find('Bank account is not sufficient')>=0)
self.assertTrue(message.find('Bank account is not sufficient')>=0)
# We will force it in order to test the next step
new_payment.plan()
else:
......@@ -298,9 +298,9 @@ class TestERP5BankingCheckPaymentMixin(TestERP5BankingMixin):
'check_payment_workflow','confirm_action')
LOG('self.assertWorkflowTransitionFails message',0,message)
if pending_account:
self.failUnless(message.find('There are operations pending for this account')>=0)
self.assertTrue(message.find('There are operations pending for this account')>=0)
if insuffisient_balance:
self.failUnless(message.find('Bank account is not sufficient')>=0)
self.assertTrue(message.find('Bank account is not sufficient')>=0)
self.assertEqual(new_payment.getSimulationState(), 'planned')
get_transaction().commit()
self.workflow_tool.doActionFor(new_payment, 'reject_action',
......@@ -319,7 +319,7 @@ class TestERP5BankingCheckPaymentMixin(TestERP5BankingMixin):
message = self.assertWorkflowTransitionFails(new_payment,
'check_payment_workflow','deliver_action')
LOG('self.assertWorkflowTransitionFails message',0,message)
self.failUnless(message.find('There are operations pending for this vault')>=0)
self.assertTrue(message.find('There are operations pending for this vault')>=0)
self.workflow_tool.doActionFor(new_payment, 'reject_action',
wf_id='check_payment_workflow')
self.workflow_tool.doActionFor(new_payment, 'cancel_action',
......@@ -490,7 +490,7 @@ class TestERP5BankingCheckPaymentMixin(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.check_payment,
'check_payment_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
def stepCheckCheckIsDelivered(self, sequence=None, sequence_list=None, **kwd):
"""
......
......@@ -270,8 +270,8 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin,
"""
message = self.assertWorkflowTransitionFails(self.checkbook_delivery,
'checkbook_delivery_workflow','deliver_action')
self.failUnless(message.find('Sorry, the item with reference')>=0)
self.failUnless(message.find('is not available any more')>=0)
self.assertTrue(message.find('Sorry, the item with reference')>=0)
self.assertTrue(message.find('is not available any more')>=0)
##################################
## Tests
......
......@@ -300,8 +300,8 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi
"""
message = self.assertWorkflowTransitionFails(self.checkbook_movement,
'checkbook_movement_workflow','confirm_to_deliver_action')
self.failUnless(message.find('Sorry, the item with reference')>=0)
self.failUnless(message.find('is not available any more')>=0)
self.assertTrue(message.find('Sorry, the item with reference')>=0)
self.assertTrue(message.find('is not available any more')>=0)
##################################
## Tests
......
......@@ -356,9 +356,9 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin):
"""
msg = self.assertWorkflowTransitionFails(self.checkbook_reception2,
'checkbook_reception_workflow', 'deliver_action')
self.failUnless(msg.find('The following references are already allocated')
self.assertTrue(msg.find('The following references are already allocated')
>=0)
self.failUnless(msg.find('50')>=0)
self.assertTrue(msg.find('50')>=0)
def stepDeliverCheckbookReception3(self, sequence=None, sequence_list=None, **kwd):
"""
......@@ -374,9 +374,9 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin):
"""
msg = self.assertWorkflowTransitionFails(self.checkbook_reception4,
'checkbook_reception_workflow', 'deliver_action')
self.failUnless(msg.find('The following references are already allocated')
self.assertTrue(msg.find('The following references are already allocated')
>=0)
self.failUnless(msg.find('150')>=0)
self.assertTrue(msg.find('150')>=0)
def stepDeliverCheckbookReception5(self, sequence=None, sequence_list=None, **kwd):
"""
......
......@@ -360,8 +360,8 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas
"""
message = self.assertWorkflowTransitionFails(self.checkbook_usual_cash_transfer,
'checkbook_usual_cash_transfer_workflow','confirm_to_deliver_action')
self.failUnless(message.find('Sorry, the item with reference')>=0)
self.failUnless(message.find('is not available any more')>=0)
self.assertTrue(message.find('Sorry, the item with reference')>=0)
self.assertTrue(message.find('is not available any more')>=0)
##################################
## Tests
......
......@@ -358,8 +358,8 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe
"""
message = self.assertWorkflowTransitionFails(self.checkbook_vault_transfer,
'checkbook_vault_transfer_workflow','deliver_action')
self.failUnless(message.find('Sorry, the item with reference')>=0)
self.failUnless(message.find('is not available any more')>=0)
self.assertTrue(message.find('Sorry, the item with reference')>=0)
self.assertTrue(message.find('is not available any more')>=0)
##################################
## Tests
......
......@@ -498,7 +498,7 @@ class TestERP5BankingClassificationSurvey(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.classification_survey,
'classification_survey_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
......@@ -485,7 +485,7 @@ class TestERP5BankingCounterRendering(TestERP5BankingMixin):
def stepDeliverFails(self, sequence=None, sequence_list=None, **kwd):
message = self.assertWorkflowTransitionFails(self.counter_rendering,
'counter_rendering_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
......@@ -420,7 +420,7 @@ class TestERP5BankingDestructionSurvey(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.destruction_survey,
'destruction_survey_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
......@@ -547,7 +547,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
cell = self.valid_line_1.getCell('emission_letter/p', variation, 'cash_status/retired')
# check the portal type
self.assertEqual(cell.getPortalType(), 'Monetary Destruction Cell')
self.failUnless(cell.getBaobabDestinationVariationText().find('new_not_emitted')>=0)
self.assertTrue(cell.getBaobabDestinationVariationText().find('new_not_emitted')>=0)
if cell.getId() == 'movement_0_0_0':
# check the quantity for coin for year 1992 is 5
self.assertEqual(cell.getQuantity(), 5.0)
......@@ -982,7 +982,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
def stepValidateFails(self, sequence=None, sequence_list=None, **kwd):
message = self.assertWorkflowTransitionFails(self.monetary_destruction,
'monetary_destruction_workflow','plan_to_deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
def stepResetInventoryForExterne(self,
sequence=None, sequence_list=None, **kwd):
......@@ -994,7 +994,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
def stepDeliverFails(self, sequence=None, sequence_list=None, **kwd):
message = self.assertWorkflowTransitionFails(self.monetary_destruction,
'monetary_destruction_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
......@@ -305,7 +305,7 @@ class TestERP5BankingMonetaryIssue(TestERP5BankingMonetaryReceptionMixin):
self.assertEqual(self.container_1.getCashNumberRangeStop(), '100')
self.assertEqual(len(self.container_1.getAggregateValueList()), 1)
self.assertEqual(self.container_1.getAggregateValueList()[0], self.cash_container_item_1)
# self.failUnless(self.container_1.getAggregateValueList()[0] == self.cash_container_item_1 or self.container_1.getAggregateValueList()[0] == self.cash_container_item_2)
# self.assertTrue(self.container_1.getAggregateValueList()[0] == self.cash_container_item_1 or self.container_1.getAggregateValueList()[0] == self.cash_container_item_2)
self.assertEqual(len(self.container_1.objectIds()), 1)
# now get the line and check it
self.container_line_1 = self.container_1.objectValues()[0]
......@@ -342,7 +342,7 @@ class TestERP5BankingMonetaryIssue(TestERP5BankingMonetaryReceptionMixin):
self.assertEqual(self.container_2.getCashNumberRangeStop(), '200')
self.assertEqual(len(self.container_2.getAggregateValueList()), 1)
self.assertEqual(self.container_2.getAggregateValueList()[0], self.cash_container_item_2)
# self.failUnless(self.container_2.getAggregateValueList()[0] == self.cash_container_item_2 or self.container_2.getAggregateValueList()[0] == self.cash_container_item_1)
# self.assertTrue(self.container_2.getAggregateValueList()[0] == self.cash_container_item_2 or self.container_2.getAggregateValueList()[0] == self.cash_container_item_1)
self.assertEqual(len(self.container_2.objectIds()), 1)
# now get the line and check it
self.container_line_2 = self.container_2.objectValues()[0]
......
......@@ -540,7 +540,7 @@ class TestERP5BankingMonetaryRecall(TestERP5BankingMixin):
def stepDeliverFails(self, sequence=None, sequence_list=None, **kwd):
message = self.assertWorkflowTransitionFails(self.monetary_recall,
'monetary_recall_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
......@@ -448,7 +448,7 @@ class TestERP5BankingMonetarySurvey(TestERP5BankingMixin):
def stepDeliverMonetarySurveyFails(self, sequence=None, sequence_list=None, **kwd):
message = self.assertWorkflowTransitionFails(self.monetary_survey,
'monetary_survey_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
......@@ -484,7 +484,7 @@ class TestERP5BankingMoneyDepositRendering(TestERP5BankingMixin):
def stepDeliverFails(self, sequence=None, sequence_list=None, **kwd):
message = self.assertWorkflowTransitionFails(self.money_deposit_rendering,
'money_deposit_rendering_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
......
......@@ -554,7 +554,7 @@ class TestERP5BankingUsualCashRendering(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.usual_cash_rendering,
'usual_cash_rendering_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
def test_01_ERP5BankingUsualCashRendering(self, quiet=QUIET, run=RUN_ALL_TEST):
"""
......
......@@ -485,7 +485,7 @@ class TestERP5BankingUsualCashTransfer(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.usual_cash_transfer,
'usual_cash_transfer_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
......
......@@ -741,7 +741,7 @@ class TestERP5BankingVaultTransfer(TestERP5BankingMixin):
"""
message = self.assertWorkflowTransitionFails(self.vault_transfer,
'vault_transfer_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0)
self.assertTrue(message.find('Insufficient balance')>=0)
##################################
## Tests
......
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