From 8ebaa20ca869398d13b5928dfe144f465fba1ee1 Mon Sep 17 00:00:00 2001 From: Sebastien Robin <seb@nexedi.com> Date: Wed, 22 Nov 2006 10:28:43 +0000 Subject: [PATCH] added description on all documents, it is necassary for some customer interfaces, fixed the usual cash transfer test git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11421 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../tests/testERP5BankingAccountIncident.py | 8 ++- .../testERP5BankingCashBalanceRegulation.py | 8 ++- .../testERP5BankingCashClassification.py | 8 ++- .../tests/testERP5BankingCashExchange.py | 9 ++- .../tests/testERP5BankingCashIncident.py | 6 +- .../tests/testERP5BankingCashMovement.py | 10 +++- .../tests/testERP5BankingCashSorting.py | 8 ++- .../testERP5BankingCashSortingIncident.py | 6 +- .../testERP5BankingCashToCurrencyPurchase.py | 9 ++- .../testERP5BankingCashToCurrencySale.py | 1 + .../tests/testERP5BankingCheckDeposit.py | 14 +++-- .../tests/testERP5BankingCheckPayment.py | 1 + .../tests/testERP5BankingCheckbookDelivery.py | 1 + .../tests/testERP5BankingCheckbookMovement.py | 10 +++- .../testERP5BankingCheckbookReception.py | 1 + ...stERP5BankingCheckbookUsualCashTransfer.py | 1 + .../testERP5BankingCheckbookVaultTransfer.py | 3 + .../testERP5BankingClassificationSurvey.py | 8 ++- .../tests/testERP5BankingCounterRendering.py | 7 ++- .../tests/testERP5BankingCurrencyPurchase.py | 4 +- .../tests/testERP5BankingCurrencySale.py | 3 +- .../tests/testERP5BankingDestructionSurvey.py | 8 ++- .../testERP5BankingForeignCashReception.py | 1 + .../testERP5BankingInternalMoneyDeposit.py | 18 +++--- .../testERP5BankingMonetaryDestruction.py | 14 +++-- .../tests/testERP5BankingMonetaryIssue.py | 6 +- .../tests/testERP5BankingMonetaryRecall.py | 8 ++- .../tests/testERP5BankingMonetaryReception.py | 10 +++- .../tests/testERP5BankingMonetarySurvey.py | 8 ++- .../tests/testERP5BankingMoneyDeposit.py | 11 ++-- .../testERP5BankingMoneyDepositRendering.py | 10 ++-- .../testERP5BankingMoneyDepositTransfer.py | 8 ++- .../tests/testERP5BankingMutilatedBanknote.py | 12 ++-- .../tests/testERP5BankingStopPayment.py | 1 + .../testERP5BankingTravelerCheckPurchase.py | 1 + .../tests/testERP5BankingTravelerCheckSale.py | 1 + .../tests/testERP5BankingUsualCashIncident.py | 6 +- .../testERP5BankingUsualCashRendering.py | 1 + .../tests/testERP5BankingUsualCashTransfer.py | 57 +++++++++++++------ .../tests/testERP5BankingVaultTransfer.py | 1 + 40 files changed, 224 insertions(+), 84 deletions(-) diff --git a/product/ERP5Banking/tests/testERP5BankingAccountIncident.py b/product/ERP5Banking/tests/testERP5BankingAccountIncident.py index 6d36dc02b0..ec585fc2e6 100755 --- a/product/ERP5Banking/tests/testERP5BankingAccountIncident.py +++ b/product/ERP5Banking/tests/testERP5BankingAccountIncident.py @@ -209,8 +209,12 @@ class TestERP5BankingAccountIncident(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash transfer document and check it """ # Cash transfer has usual_cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.account_incident = self.account_incident_module.newContent(id='account_incident_1', portal_type='Account Incident', source_total_asset_price=52400.0, - destination_payment_value=self.bank_account_1) + self.account_incident = self.account_incident_module.newContent( + id='account_incident_1', + portal_type='Account Incident', + source_total_asset_price=52400.0, + description='test', + destination_payment_value=self.bank_account_1) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py b/product/ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py index 924add9d58..1f036df69f 100644 --- a/product/ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py +++ b/product/ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py @@ -272,7 +272,13 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas def stepCreateCashBalanceRegulation(self, sequence=None, sequence_list=None, **kwd): - self.cash_balance_regulation = self.cash_balance_regulation_module.newContent(id='cash_balance_regulation_1', portal_type='Cash Balance Regulation', source_value=self.guichet_1, destination_value=None, source_total_asset_price=52400.0) + self.cash_balance_regulation = self.cash_balance_regulation_module.newContent( + id='cash_balance_regulation_1', + portal_type='Cash Balance Regulation', + source_value=self.guichet_1, + destination_value=None, + description='test', + source_total_asset_price=52400.0) self.stepTic() self.assertEqual(len(self.cash_balance_regulation_module.objectValues()), 1) self.cash_balance_regulation = getattr(self.cash_balance_regulation_module, 'cash_balance_regulation_1') diff --git a/product/ERP5Banking/tests/testERP5BankingCashClassification.py b/product/ERP5Banking/tests/testERP5BankingCashClassification.py index 5810365e05..7203dbe8fb 100755 --- a/product/ERP5Banking/tests/testERP5BankingCashClassification.py +++ b/product/ERP5Banking/tests/testERP5BankingCashClassification.py @@ -220,7 +220,13 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash sorting document and check it """ # Cash sorting has encaisse_paris for source, encaisse_externe for destination, and a price cooreponding to the sum of banknote of 10000 and banknotes of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.cash_sorting = self.cash_sorting_module.newContent(id='cash_sorting_1', portal_type='Cash Sorting', source_value=self.encaisse_tri, destination_value=None, source_total_asset_price=52400.0) + self.cash_sorting = self.cash_sorting_module.newContent( + id='cash_sorting_1', + portal_type='Cash Sorting', + source_value=self.encaisse_tri, + description='test', + destination_value=None, + source_total_asset_price=52400.0) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingCashExchange.py b/product/ERP5Banking/tests/testERP5BankingCashExchange.py index ee841d3ff0..e427608900 100644 --- a/product/ERP5Banking/tests/testERP5BankingCashExchange.py +++ b/product/ERP5Banking/tests/testERP5BankingCashExchange.py @@ -229,7 +229,14 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash sorting document and check it """ # Cash sorting has encaisse_paris for source, guichet_1 for destination, and a price cooreponding to the sum of banknote of 10000 and banknotes of 200 ( (2+3) * 10000 + (2+3) * 200 ) - self.cash_exchange = self.cash_exchange_module.newContent(id='cash_exchange_1', portal_type='Cash Exchange', source_value=self.guichet, destination_value=None, resource_value = self.currency_1, source_total_asset_price=52400.0) + self.cash_exchange = self.cash_exchange_module.newContent( + id='cash_exchange_1', + portal_type='Cash Exchange', + source_value=self.guichet, + destination_value=None, + description='test', + resource_value = self.currency_1, + source_total_asset_price=52400.0) # execute tic self.stepTic() # check we have only one cash sorting diff --git a/product/ERP5Banking/tests/testERP5BankingCashIncident.py b/product/ERP5Banking/tests/testERP5BankingCashIncident.py index 3c6165d183..5766a17088 100755 --- a/product/ERP5Banking/tests/testERP5BankingCashIncident.py +++ b/product/ERP5Banking/tests/testERP5BankingCashIncident.py @@ -178,7 +178,11 @@ class TestERP5BankingCashIncident(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash transfer document and check it """ # Cash transfer has usual_cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.cash_incident = self.cash_incident_module.newContent(id='cash_incident_1', portal_type='Cash Incident', source_total_asset_price=52400.0,) + self.cash_incident = self.cash_incident_module.newContent( + id='cash_incident_1', + portal_type='Cash Incident', + description='test', + source_total_asset_price=52400.0,) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingCashMovement.py b/product/ERP5Banking/tests/testERP5BankingCashMovement.py index 9820f572ee..d0991f42c3 100644 --- a/product/ERP5Banking/tests/testERP5BankingCashMovement.py +++ b/product/ERP5Banking/tests/testERP5BankingCashMovement.py @@ -228,9 +228,13 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): # Cash Movement has vault_source (Gros versment) for source, vault_destination for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.cash_movement = self.cash_movement_module.newContent(id='cash_movement_1', - portal_type='Cash Movement', source=self.vault_source.getRelativeUrl(), - destination=self.vault_destination.getRelativeUrl(), source_total_asset_price=52400.0) + self.cash_movement = self.cash_movement_module.newContent( + id='cash_movement_1', + portal_type='Cash Movement', + source=self.vault_source.getRelativeUrl(), + destination=self.vault_destination.getRelativeUrl(), + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() # check we have only one vault transfer diff --git a/product/ERP5Banking/tests/testERP5BankingCashSorting.py b/product/ERP5Banking/tests/testERP5BankingCashSorting.py index 4694077374..1dc9b44fda 100755 --- a/product/ERP5Banking/tests/testERP5BankingCashSorting.py +++ b/product/ERP5Banking/tests/testERP5BankingCashSorting.py @@ -220,7 +220,13 @@ class TestERP5BankingCashSorting(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash sorting document and check it """ # Cash sorting has encaisse_paris for source, encaisse_externe for destination, and a price cooreponding to the sum of banknote of 10000 and banknotes of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.cash_sorting = self.cash_sorting_module.newContent(id='cash_sorting_1', portal_type='Cash Sorting', source_value=self.encaisse_tri, destination_value=None, source_total_asset_price=52400.0) + self.cash_sorting = self.cash_sorting_module.newContent( + id='cash_sorting_1', + portal_type='Cash Sorting', + source_value=self.encaisse_tri, + destination_value=None, + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingCashSortingIncident.py b/product/ERP5Banking/tests/testERP5BankingCashSortingIncident.py index 0687c35728..4c0e5480e9 100755 --- a/product/ERP5Banking/tests/testERP5BankingCashSortingIncident.py +++ b/product/ERP5Banking/tests/testERP5BankingCashSortingIncident.py @@ -196,7 +196,11 @@ class TestERP5BankingCashSortingIncident(TestERP5BankingMixin, ERP5TypeTestCase) Create a cash transfer document and check it """ # Cash transfer has usual_cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.cash_sorting_incident = self.cash_sorting_incident_module.newContent(id='cash_sorting_incident_1', portal_type='Cash Sorting Incident', source_total_asset_price=52400.0,) + self.cash_sorting_incident = self.cash_sorting_incident_module.newContent( + id='cash_sorting_incident_1', + portal_type='Cash Sorting Incident', + description='test', + source_total_asset_price=52400.0,) # execute tic self.stepTic() # check we have only one cash transfer diff --git a/product/ERP5Banking/tests/testERP5BankingCashToCurrencyPurchase.py b/product/ERP5Banking/tests/testERP5BankingCashToCurrencyPurchase.py index a155440b79..3c31885d12 100644 --- a/product/ERP5Banking/tests/testERP5BankingCashToCurrencyPurchase.py +++ b/product/ERP5Banking/tests/testERP5BankingCashToCurrencyPurchase.py @@ -223,7 +223,14 @@ class TestERP5BankingCashToCurrencyPurchase(TestERP5BankingMixin, ERP5TypeTestCa Create a cash sorting document and check it """ # Cash sorting has encaisse_paris for source, guichet_1 for destination, and a price cooreponding to the sum of banknote of 10000 and banknotes of 200 ( (2+3) * 10000 + (2+3) * 200 ) - self.cash_to_currency_purchase = self.cash_to_currency_purchase_module.newContent(id='cash_to_currency_purchase_1', portal_type='Cash To Currency Purchase', source_value=self.guichet, destination_value=None, resource_value = self.currency_2, source_total_asset_price=100.0) + self.cash_to_currency_purchase = self.cash_to_currency_purchase_module.newContent( + id='cash_to_currency_purchase_1', + portal_type='Cash To Currency Purchase', + source_value=self.guichet, + destination_value=None, + description='test', + resource_value = self.currency_2, + source_total_asset_price=100.0) # execute tic self.stepTic() # check we have only one cash sorting diff --git a/product/ERP5Banking/tests/testERP5BankingCashToCurrencySale.py b/product/ERP5Banking/tests/testERP5BankingCashToCurrencySale.py index f3c0682bc0..37f4102da7 100644 --- a/product/ERP5Banking/tests/testERP5BankingCashToCurrencySale.py +++ b/product/ERP5Banking/tests/testERP5BankingCashToCurrencySale.py @@ -212,6 +212,7 @@ class TestERP5BankingCashToCurrencySale(TestERP5BankingMixin, ERP5TypeTestCase): portal_type='Cash To Currency Sale', source_value=self.guichet, destination_value=None, + description='test', resource_value = self.currency_2, source_total_asset_price=100.0, discount = 3000.0, quantity = 70000.0) diff --git a/product/ERP5Banking/tests/testERP5BankingCheckDeposit.py b/product/ERP5Banking/tests/testERP5BankingCheckDeposit.py index 16163c1731..926f65bf18 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckDeposit.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckDeposit.py @@ -178,12 +178,14 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): """ Create a check deposit document and check it """ - self.check_deposit = self.check_deposit_module.newContent(id = 'check_deposit', - portal_type = 'Check Deposit', - destination_payment_value = self.bank_account_1, - start_date = DateTime().Date(), - source_total_asset_price = 500.0, - resource_value=self.currency_1) + self.check_deposit = self.check_deposit_module.newContent( + id = 'check_deposit', + portal_type = 'Check Deposit', + destination_payment_value = self.bank_account_1, + start_date = DateTime().Date(), + source_total_asset_price = 500.0, + description='test', + resource_value=self.currency_1) self.assertNotEqual(self.check_deposit, None) self.assertEqual(self.check_deposit.getTotalPrice(), 0.0) diff --git a/product/ERP5Banking/tests/testERP5BankingCheckPayment.py b/product/ERP5Banking/tests/testERP5BankingCheckPayment.py index 0a5da0d2b4..85a42f1556 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckPayment.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckPayment.py @@ -220,6 +220,7 @@ class TestERP5BankingCheckPaymentMixin: # aggregate_value = self.check_1, resource_value = self.currency_1, aggregate_free_text = "50", + description = "test", # source_value = self.bi_counter, start_date = DateTime().Date(), source_total_asset_price = 20000.0) diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookDelivery.py b/product/ERP5Banking/tests/testERP5BankingCheckbookDelivery.py index 844806d904..c9a6de6a70 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookDelivery.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookDelivery.py @@ -235,6 +235,7 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin, resource_value=self.checkbook_model_1, check_amount_value=self.checkbook_model_1.variant_1, reference_range_min=1, + description='test', reference_range_max=50, aggregate_value=self.checkbook_1 ) diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookMovement.py b/product/ERP5Banking/tests/testERP5BankingCheckbookMovement.py index d8c6ca8b13..8dd9dbc7b6 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookMovement.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookMovement.py @@ -182,9 +182,13 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi """ # We will do the transfer ot two items. self.checkbook_movement = self.checkbook_movement_module.newContent( - id='checkbook_movement', portal_type='Checkbook Movement', - source_value=self.source_site, destination_value=self.destination_site, - resource_value=self.currency_1,start_date=self.date) + id='checkbook_movement', + portal_type='Checkbook Movement', + source_value=self.source_site, + destination_value=self.destination_site, + resource_value=self.currency_1, + description='test', + start_date=self.date) # check its portal type self.assertEqual(self.checkbook_movement.getPortalType(), 'Checkbook Movement') # check source diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookReception.py b/product/ERP5Banking/tests/testERP5BankingCheckbookReception.py index e3ccbb9e59..68f253eb9e 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookReception.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookReception.py @@ -166,6 +166,7 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): id='checkbook_reception', portal_type='Checkbook Reception', source_value=None, destination_value=self.destination_site, resource_value=self.currency_1, + description='test', start_date=self.date) # get the checkbook reception document self.checkbook_reception = getattr(self.checkbook_reception_module, 'checkbook_reception') diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookUsualCashTransfer.py b/product/ERP5Banking/tests/testERP5BankingCheckbookUsualCashTransfer.py index 1a088fe309..a2cd5e6f2f 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookUsualCashTransfer.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookUsualCashTransfer.py @@ -93,6 +93,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin( id='checkbook_vault_transfer', portal_type='Checkbook Vault Transfer', source_value=self.vault_transfer_source_site, destination_value=self.vault_transfer_destination_site, + description='test', start_date=(self.date-3)) # Add a line for traveler check self.line_2 = self.checkbook_vault_transfer.newContent(quantity=1, diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookVaultTransfer.py b/product/ERP5Banking/tests/testERP5BankingCheckbookVaultTransfer.py index 1540dba1e2..5ecf28ea79 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookVaultTransfer.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookVaultTransfer.py @@ -54,6 +54,7 @@ class TestERP5BankingCheckbookVaultTransferMixin: self.checkbook_reception = self.checkbook_reception_module.newContent( id='checkbook_reception', portal_type='Checkbook Reception', source_value=None, destination_value=self.reception_destination_site, + description='test', start_date=(self.date-4)) # get the checkbook reception document self.checkbook_reception = getattr(self.checkbook_reception_module, 'checkbook_reception') @@ -86,6 +87,7 @@ class TestERP5BankingCheckbookVaultTransferMixin: self.checkbook_reception = self.checkbook_reception_module.newContent( id='checkbook_reception', portal_type='Checkbook Reception', source_value=None, destination_value=self.reception_destination_site, + description='test', start_date=(self.date-4)) # get the checkbook reception document self.checkbook_reception = getattr(self.checkbook_reception_module, 'checkbook_reception') @@ -264,6 +266,7 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe self.checkbook_vault_transfer = self.checkbook_vault_transfer_module.newContent( id='checkbook_vault_transfer', portal_type='Checkbook Vault Transfer', source_value=self.source_site, destination_value=self.destination_site, + description='test', resource_value=self.currency_1) # check its portal type self.assertEqual(self.checkbook_vault_transfer.getPortalType(), 'Checkbook Vault Transfer') diff --git a/product/ERP5Banking/tests/testERP5BankingClassificationSurvey.py b/product/ERP5Banking/tests/testERP5BankingClassificationSurvey.py index 9064a66295..d7adfdccf7 100755 --- a/product/ERP5Banking/tests/testERP5BankingClassificationSurvey.py +++ b/product/ERP5Banking/tests/testERP5BankingClassificationSurvey.py @@ -197,7 +197,13 @@ class TestERP5BankingClassificationSurvey(TestERP5BankingMixin, ERP5TypeTestCase Create a classification surveyg document and check it """ # classification surveyg has encaisse_paris for source, encaisse_externe for destination, and a price cooreponding to the sum of banknote of 10000 and banknotes of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.classification_survey = self.classification_survey_module.newContent(id='classification_survey_1', portal_type='Classification Survey', source_value=self.encaisse_a_detruire, destination_value=None, source_total_asset_price=52400.0) + self.classification_survey = self.classification_survey_module.newContent( + id='classification_survey_1', + portal_type='Classification Survey', + source_value=self.encaisse_a_detruire, + destination_value=None, + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingCounterRendering.py b/product/ERP5Banking/tests/testERP5BankingCounterRendering.py index 0927eab4fd..d6b2b0624d 100644 --- a/product/ERP5Banking/tests/testERP5BankingCounterRendering.py +++ b/product/ERP5Banking/tests/testERP5BankingCounterRendering.py @@ -227,7 +227,12 @@ class TestERP5BankingCounterRendering(TestERP5BankingMixin, ERP5TypeTestCase): """ # Counter rendering has usual_cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.counter_rendering = self.counter_rendering_module.newContent(id='counter_rendering_1', portal_type='Counter Rendering', source_value=self.counter_vault, source_total_asset_price=52400.0) + self.counter_rendering = self.counter_rendering_module.newContent( + id='counter_rendering_1', + portal_type='Counter Rendering', + source_value=self.counter_vault, + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() # check we have only one counter rendering diff --git a/product/ERP5Banking/tests/testERP5BankingCurrencyPurchase.py b/product/ERP5Banking/tests/testERP5BankingCurrencyPurchase.py index dce5912361..430438e55e 100644 --- a/product/ERP5Banking/tests/testERP5BankingCurrencyPurchase.py +++ b/product/ERP5Banking/tests/testERP5BankingCurrencyPurchase.py @@ -169,10 +169,8 @@ class TestERP5BankingCurrencyPurchase(TestERP5BankingMixin, ERP5TypeTestCase): self.currency_purchase = self.currency_purchase_module.newContent(id = 'currency_purchase', portal_type = 'Currency Purchase', price_currency='currency_module/EUR',currency_exchange_type='purchase', destination_payment_value = self.bank_account_1, - # aggregate_value = self.check_1, resource_value = self.currency_2, - - # source_value = self.bi_counter, + description='test', start_date = DateTime().Date(), source_total_asset_price = 100.0, discount = 1000.0) diff --git a/product/ERP5Banking/tests/testERP5BankingCurrencySale.py b/product/ERP5Banking/tests/testERP5BankingCurrencySale.py index 9bf63b0768..4d6a560d2f 100644 --- a/product/ERP5Banking/tests/testERP5BankingCurrencySale.py +++ b/product/ERP5Banking/tests/testERP5BankingCurrencySale.py @@ -188,9 +188,8 @@ class TestERP5BankingCurrencySale(TestERP5BankingMixin, ERP5TypeTestCase): self.currency_sale = self.currency_sale_module.newContent(id = 'currency_sale', portal_type = 'Currency Sale', price_currency='currency_module/EUR',currency_exchange_type='sale', destination_payment_value = self.bank_account_1, - # aggregate_value = self.check_1, resource_value = self.currency_2, - # source_value = self.bi_counter, + description='test', start_date = DateTime().Date(), source_total_asset_price = 100.0, discount = 3000.0, diff --git a/product/ERP5Banking/tests/testERP5BankingDestructionSurvey.py b/product/ERP5Banking/tests/testERP5BankingDestructionSurvey.py index 14049e3fed..3e665bf699 100644 --- a/product/ERP5Banking/tests/testERP5BankingDestructionSurvey.py +++ b/product/ERP5Banking/tests/testERP5BankingDestructionSurvey.py @@ -168,7 +168,13 @@ class TestERP5BankingDestructionSurvey(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash transfer document and check it """ # Cash transfer has cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.destruction_survey = self.destruction_survey_module.newContent(id='destruction_survey_1', portal_type='Destruction Survey', source_value=self.cash, destination_value=self.counter, source_total_asset_price=52400.0) + self.destruction_survey = self.destruction_survey_module.newContent( + id='destruction_survey_1', + portal_type='Destruction Survey', + source_value=self.cash, + description='test', + destination_value=self.counter, + source_total_asset_price=52400.0) # execute tic self.stepTic() # check we have only one cash transfer diff --git a/product/ERP5Banking/tests/testERP5BankingForeignCashReception.py b/product/ERP5Banking/tests/testERP5BankingForeignCashReception.py index d09d057981..a04bc0e646 100755 --- a/product/ERP5Banking/tests/testERP5BankingForeignCashReception.py +++ b/product/ERP5Banking/tests/testERP5BankingForeignCashReception.py @@ -155,6 +155,7 @@ class TestERP5BankingForeignCashReception(TestERP5BankingMixin, ERP5TypeTestCase id='foreign_cash_reception', portal_type='Foreign Cash Reception', source_value=None, destination_value=self.reception, resource_value=self.currency_1, + description='test', source_total_asset_price=250) # execute tic self.stepTic() diff --git a/product/ERP5Banking/tests/testERP5BankingInternalMoneyDeposit.py b/product/ERP5Banking/tests/testERP5BankingInternalMoneyDeposit.py index e6be1055c2..b9a6997ccf 100644 --- a/product/ERP5Banking/tests/testERP5BankingInternalMoneyDeposit.py +++ b/product/ERP5Banking/tests/testERP5BankingInternalMoneyDeposit.py @@ -190,15 +190,15 @@ class TestERP5BankingInternalMoneyDeposit(TestERP5BankingMixin, ERP5TypeTestCase Create a cash sorting document and check it """ # Cash sorting has encaisse_paris for source, guichet_1 for destination, and a price cooreponding to the sum of banknote of 10000 and banknotes of 200 ( (2+3) * 10000 + (2+3) * 200 ) - self.internal_money_deposit = self.internal_money_deposit_module.newContent(id='internal_money_deposit', portal_type='Internal Money Deposit', - #source_value=None, destination_value=self.bi_counter_vault, - destination_value=self.bi_counter_vault, - source_value=None, - #destination_payment_value = self.bank_account_1, - resource_value = self.currency_1, - source_total_asset_price=20000.0, - grouping_reference="lettering", - ) + self.internal_money_deposit = self.internal_money_deposit_module.newContent( + id='internal_money_deposit', + portal_type='Internal Money Deposit', + destination_value=self.bi_counter_vault, + resource_value = self.currency_1, + source_total_asset_price=20000.0, + grouping_reference="lettering", + description='test', + ) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py b/product/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py index 6d8628f976..ab37052110 100644 --- a/product/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py +++ b/product/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py @@ -265,12 +265,14 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin, ERP5TypeTestCase) """ #print self.portal.portal_categories.objectIds() # Monetary Destruction has source(serre) for source, destinat (serre) for destination, and a price coresponding to the sum of banknote of 10000 and of 5000 ( (2*3) * 10000 + (5*7) * 5000 ) - self.monetary_destruction = self.monetary_destruction_module.newContent(id='monetary_destruction_1', - portal_type='Monetary Destruction', - source_value=self.source, - destination_value=None, - source_total_asset_price=110000.0, - source_section_value=self.paris) + self.monetary_destruction = self.monetary_destruction_module.newContent( + id='monetary_destruction_1', + portal_type='Monetary Destruction', + source_value=self.source, + destination_value=None, + source_total_asset_price=110000.0, + description='test', + source_section_value=self.paris) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingMonetaryIssue.py b/product/ERP5Banking/tests/testERP5BankingMonetaryIssue.py index 9400c73031..8f915ca89a 100755 --- a/product/ERP5Banking/tests/testERP5BankingMonetaryIssue.py +++ b/product/ERP5Banking/tests/testERP5BankingMonetaryIssue.py @@ -217,7 +217,11 @@ class TestERP5BankingMonetaryIssue(TestERP5BankingMonetaryReceptionMixin, TestER # issue date must be a bit in the future so regenerate date self.current_date = DateTime() # Cash inventory has caisse_1 for source, caisse_2 for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.monetary_issue = self.monetary_issue_module.newContent(id='monetary_issue', portal_type='Monetary Issue', start_date=self.current_date) + self.monetary_issue = self.monetary_issue_module.newContent( + id='monetary_issue', + portal_type='Monetary Issue', + description='test', + start_date=self.current_date) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingMonetaryRecall.py b/product/ERP5Banking/tests/testERP5BankingMonetaryRecall.py index 0459d1e12f..f660a5e68d 100755 --- a/product/ERP5Banking/tests/testERP5BankingMonetaryRecall.py +++ b/product/ERP5Banking/tests/testERP5BankingMonetaryRecall.py @@ -228,8 +228,12 @@ class TestERP5BankingMonetaryRecall(TestERP5BankingMixin, ERP5TypeTestCase): Create a monetary recall document and check it """ # Cash transfer has cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - #self.monetary_recall = self.monetary_recall_module.newContent(id='monetary_recall_1', portal_type='Monetary Recall', source_value=self.cash, #destination_value=self.counter, source_total_asset_price=52400.0) - self.monetary_recall = self.monetary_recall_module.newContent(id='monetary_recall_1', portal_type='Monetary Recall', source_value=self.cash, source_total_asset_price=52400.0) + self.monetary_recall = self.monetary_recall_module.newContent( + id='monetary_recall_1', + portal_type='Monetary Recall', + source_value=self.cash, + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() diff --git a/product/ERP5Banking/tests/testERP5BankingMonetaryReception.py b/product/ERP5Banking/tests/testERP5BankingMonetaryReception.py index 6076712214..9948a31fd0 100755 --- a/product/ERP5Banking/tests/testERP5BankingMonetaryReception.py +++ b/product/ERP5Banking/tests/testERP5BankingMonetaryReception.py @@ -154,9 +154,13 @@ class TestERP5BankingMonetaryReception(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash inventory document and check it """ # Cash inventory has caisse_1 for source, caisse_2 for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.monetary_reception = self.monetary_reception_module.newContent(id='monetary_reception', portal_type='Monetary Reception', - source_value=None, destination_value=self.reception, - resource_value=self.currency_1) + self.monetary_reception = self.monetary_reception_module.newContent( + id='monetary_reception', + portal_type='Monetary Reception', + source_value=None, + destination_value=self.reception, + description='test', + resource_value=self.currency_1) # self.setDestinationValue(self.reception) # self.setResourceValue(self.currency_1) # execute tic diff --git a/product/ERP5Banking/tests/testERP5BankingMonetarySurvey.py b/product/ERP5Banking/tests/testERP5BankingMonetarySurvey.py index 17643547e6..7bf706ddbf 100755 --- a/product/ERP5Banking/tests/testERP5BankingMonetarySurvey.py +++ b/product/ERP5Banking/tests/testERP5BankingMonetarySurvey.py @@ -193,7 +193,13 @@ class TestERP5BankingMonetarySurvey(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash transfer document and check it """ # Cash transfer has usual_cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.monetary_survey = self.monetary_survey_module.newContent(id='monetary_survey_1', portal_type='Monetary Survey', source_value=self.source, destination_value=self.destination, source_total_asset_price=52400.0) + self.monetary_survey = self.monetary_survey_module.newContent( + id='monetary_survey_1', + portal_type='Monetary Survey', + source_value=self.source, + destination_value=self.destination, + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py b/product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py index 05f6af4602..77b0a82d5b 100644 --- a/product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py +++ b/product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py @@ -209,10 +209,13 @@ class TestERP5BankingMoneyDepositMixin: Create a cash sorting document and check it """ # Cash sorting has encaisse_paris for source, guichet_1 for destination, and a price cooreponding to the sum of banknote of 10000 and banknotes of 200 ( (2+3) * 10000 + (2+3) * 200 ) - self.money_deposit = self.money_deposit_module.newContent(id='money_deposit', portal_type='Money Deposit', - destination_payment_value = self.bank_account_1, - resource_value = self.currency_1, - source_total_asset_price=20000.0) + self.money_deposit = self.money_deposit_module.newContent( + id='money_deposit', + portal_type='Money Deposit', + destination_payment_value = self.bank_account_1, + resource_value = self.currency_1, + description='test', + source_total_asset_price=20000.0) # execute tic self.stepTic() # set source reference diff --git a/product/ERP5Banking/tests/testERP5BankingMoneyDepositRendering.py b/product/ERP5Banking/tests/testERP5BankingMoneyDepositRendering.py index bba9ab3e6c..52106e42d3 100644 --- a/product/ERP5Banking/tests/testERP5BankingMoneyDepositRendering.py +++ b/product/ERP5Banking/tests/testERP5BankingMoneyDepositRendering.py @@ -234,10 +234,12 @@ class TestERP5BankingMoneyDepositRendering(TestERP5BankingMixin, ERP5TypeTestCas """ # Money deposit rendering has auxiliaire for source, gros_versement for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.money_deposit_rendering = self.money_deposit_rendering_module.newContent(id='money_deposit_rendering_1', - portal_type='Money Deposit Rendering', - source_value=self.gros_versement, - source_total_asset_price=52400.0) + self.money_deposit_rendering = self.money_deposit_rendering_module.newContent( + id='money_deposit_rendering_1', + portal_type='Money Deposit Rendering', + source_value=self.gros_versement, + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() # check we have only one money deposit rendering diff --git a/product/ERP5Banking/tests/testERP5BankingMoneyDepositTransfer.py b/product/ERP5Banking/tests/testERP5BankingMoneyDepositTransfer.py index ed82e2ae9a..f7d86880fb 100644 --- a/product/ERP5Banking/tests/testERP5BankingMoneyDepositTransfer.py +++ b/product/ERP5Banking/tests/testERP5BankingMoneyDepositTransfer.py @@ -207,7 +207,13 @@ class TestERP5BankingMoneyDepositTransfer(TestERP5BankingMixin, ERP5TypeTestCase Create a money deposit transfer document and check it """ # Money Deposit transfer has usual_cash (Gros versment) for source, tri for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.money_deposit_transfer = self.money_deposit_transfer_module.newContent(id='money_deposit_transfer_1', portal_type='Money Deposit Transfer', source_value=self.counter, destination_value=self.tri, source_total_asset_price=52400.0) + self.money_deposit_transfer = self.money_deposit_transfer_module.newContent( + id='money_deposit_transfer_1', + portal_type='Money Deposit Transfer', + source_value=self.counter, + destination_value=self.tri, + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() # check we have only one money deposit transfer diff --git a/product/ERP5Banking/tests/testERP5BankingMutilatedBanknote.py b/product/ERP5Banking/tests/testERP5BankingMutilatedBanknote.py index 5a52ba2cea..2aa0f0b174 100755 --- a/product/ERP5Banking/tests/testERP5BankingMutilatedBanknote.py +++ b/product/ERP5Banking/tests/testERP5BankingMutilatedBanknote.py @@ -159,11 +159,13 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): """ Create a mutilated banknote document and check it """ - self.mutilated_banknote = self.mutilated_banknote_module.newContent(id='mutilated_banknote', - portal_type='Mutilated Banknote', - source_total_asset_price=0.0, - destination_total_asset_price=0.0, - destination_value=self.mutilated_banknote_vault + self.mutilated_banknote = self.mutilated_banknote_module.newContent( + id='mutilated_banknote', + portal_type='Mutilated Banknote', + source_total_asset_price=0.0, + destination_total_asset_price=0.0, + description='test', + destination_value=self.mutilated_banknote_vault ) self.stepTic() self.assertEqual(len(self.mutilated_banknote_module.objectValues()), 1) diff --git a/product/ERP5Banking/tests/testERP5BankingStopPayment.py b/product/ERP5Banking/tests/testERP5BankingStopPayment.py index 66b8f05cb5..f28760db8e 100755 --- a/product/ERP5Banking/tests/testERP5BankingStopPayment.py +++ b/product/ERP5Banking/tests/testERP5BankingStopPayment.py @@ -142,6 +142,7 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin, id='stop_payment', portal_type='Stop Payment', destination_payment_value=self.bank_account_2, resource_value=self.currency_1, + description='test', start_date=self.date, reference_range_min=51, source_total_asset_price=20000) diff --git a/product/ERP5Banking/tests/testERP5BankingTravelerCheckPurchase.py b/product/ERP5Banking/tests/testERP5BankingTravelerCheckPurchase.py index 939be2c664..c29e0e04a0 100755 --- a/product/ERP5Banking/tests/testERP5BankingTravelerCheckPurchase.py +++ b/product/ERP5Banking/tests/testERP5BankingTravelerCheckPurchase.py @@ -174,6 +174,7 @@ class TestERP5BankingTravelerCheckPurchase(TestERP5BankingCheckbookUsualCashTran source_value=self.traveler_check_source, destination_value=None, destination_payment_value=self.bank_account_1, resource_value=self.currency_1, + description='test', start_date=self.date) # check its portal type self.assertEqual(self.traveler_check_purchase.getPortalType(), 'Traveler Check Purchase') diff --git a/product/ERP5Banking/tests/testERP5BankingTravelerCheckSale.py b/product/ERP5Banking/tests/testERP5BankingTravelerCheckSale.py index 142cb181ec..6db0b4b580 100755 --- a/product/ERP5Banking/tests/testERP5BankingTravelerCheckSale.py +++ b/product/ERP5Banking/tests/testERP5BankingTravelerCheckSale.py @@ -67,6 +67,7 @@ class TestERP5BankingTravelerCheckSaleMixin: self.checkbook_vault_transfer = self.getCheckbookUsualCashTransferModule().newContent( id='checkbook_usual_cash_transfer', portal_type='Checkbook Usual Cash Transfer', source_value=self.source_vault, + description='test', destination_value=self.destination_vault, start_date=(self.date-1)) # Add a line for traveler check diff --git a/product/ERP5Banking/tests/testERP5BankingUsualCashIncident.py b/product/ERP5Banking/tests/testERP5BankingUsualCashIncident.py index 2d968be190..efd5bc2fc3 100755 --- a/product/ERP5Banking/tests/testERP5BankingUsualCashIncident.py +++ b/product/ERP5Banking/tests/testERP5BankingUsualCashIncident.py @@ -180,7 +180,11 @@ class TestERP5BankingUsualCashIncident(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash transfer document and check it """ # Cash transfer has usual_cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.usual_cash_incident = self.usual_cash_incident_module.newContent(id='usual_cash_incident_1', portal_type='Usual Cash Incident', source_total_asset_price=52400.0,) + self.usual_cash_incident = self.usual_cash_incident_module.newContent( + id='usual_cash_incident_1', + portal_type='Usual Cash Incident', + description='test', + source_total_asset_price=52400.0,) # execute tic self.stepTic() # check we have only one cash transfer diff --git a/product/ERP5Banking/tests/testERP5BankingUsualCashRendering.py b/product/ERP5Banking/tests/testERP5BankingUsualCashRendering.py index 0a5246ae5f..a9c88bca35 100644 --- a/product/ERP5Banking/tests/testERP5BankingUsualCashRendering.py +++ b/product/ERP5Banking/tests/testERP5BankingUsualCashRendering.py @@ -226,6 +226,7 @@ class TestERP5BankingUsualCashRendering(TestERP5BankingMixin, ERP5TypeTestCase): self.usual_cash_rendering = self.usual_cash_rendering_module.newContent(id='usual_cash_rendering_1', portal_type='Usual Cash Rendering', source=self.caisse_courante.getRelativeUrl(), + description='test', destination=self.auxiliaire.getRelativeUrl(), source_total_asset_price=52400.0) # execute tic self.stepTic() diff --git a/product/ERP5Banking/tests/testERP5BankingUsualCashTransfer.py b/product/ERP5Banking/tests/testERP5BankingUsualCashTransfer.py index 33e4a35c77..ff75adaf1c 100755 --- a/product/ERP5Banking/tests/testERP5BankingUsualCashTransfer.py +++ b/product/ERP5Banking/tests/testERP5BankingUsualCashTransfer.py @@ -148,13 +148,28 @@ class TestERP5BankingUsualCashTransfer(TestERP5BankingMixin, ERP5TypeTestCase): line_list = [inventory_dict_line_1, inventory_dict_line_2] self.usual_cash = self.paris.surface.caisse_courante.encaisse_des_billets_et_monnaies - self.counter = self.paris.surface.banque_interne.guichet_1.encaisse_des_billets_et_monnaies - self.counter_vault = self.paris.surface.banque_interne.guichet_1.encaisse_des_billets_et_monnaies.sortante - self.openCounterDate(site=self.paris) - self.openCounter(self.counter) + self.counter = self.paris.surface.banque_interne.guichet_1 + self.counter_vault = self.paris.surface.banque_interne.guichet_1.encaisse_des_billets_et_monnaies + self.counter_final_vault = self.paris.surface.banque_interne.guichet_1.encaisse_des_billets_et_monnaies.sortante self.createCashInventory(source=None, destination=self.usual_cash, currency=self.currency_1, line_list=line_list) + # now we need to create a user as Manager to do the test + # in order to have an assigment defined which is used to do transition + # Create an Organisation that will be used for users assignment + self.checkUserFolderType() + self.organisation = self.organisation_module.newContent(id='baobab_org', portal_type='Organisation', + function='banking', group='baobab', site='testsite/paris') + # define the user + user_dict = { + 'super_user' : [['Manager'], self.organisation, 'banking/comptable', 'baobab', 'testsite/paris/surface/banque_interne/guichet_1'] + } + # call method to create this user + self.createERP5Users(user_dict) + self.logout() + self.login('super_user') + self.openCounterDate(site=self.paris) + self.openCounter(self.counter) def stepCheckObjects(self, sequence=None, sequence_list=None, **kwd): """ @@ -199,11 +214,11 @@ class TestERP5BankingUsualCashTransfer(TestERP5BankingMixin, ERP5TypeTestCase): Check inventory in destination vault (counter) before confirm """ # check we don't have banknotes of 10000 - self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0) - self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0) + self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0) + self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0) # check we don't have coins of 200 - self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) - self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) + self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) + self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) def stepCreateUsualCashTransfer(self, sequence=None, sequence_list=None, **kwd): @@ -211,7 +226,13 @@ class TestERP5BankingUsualCashTransfer(TestERP5BankingMixin, ERP5TypeTestCase): Create a cash transfer document and check it """ # Cash transfer has usual_cash for source, counter for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 ) - self.usual_cash_transfer = self.usual_cash_transfer_module.newContent(id='usual_cash_transfer_1', portal_type='Usual Cash Transfer', source_value=self.usual_cash, destination_value=self.counter, source_total_asset_price=52400.0) + self.usual_cash_transfer = self.usual_cash_transfer_module.newContent( + id='usual_cash_transfer_1', + portal_type='Usual Cash Transfer', + source_value=self.usual_cash, + destination_value=self.counter_vault, + description='test', + source_total_asset_price=52400.0) # execute tic self.stepTic() # check we have only one cash transfer @@ -262,7 +283,7 @@ class TestERP5BankingUsualCashTransfer(TestERP5BankingMixin, ERP5TypeTestCase): # check the source vault is usual_cash self.assertEqual(cell.getSourceValue(), self.usual_cash) # check the destination vault is counter - self.assertEqual(cell.getDestinationValue(), self.counter) + self.assertEqual(cell.getDestinationValue(), self.counter_vault) if cell.getId() == 'movement_0_0_0': # check the quantity of banknote for year 1992 is 2 self.assertEqual(cell.getQuantity(), 2.0) @@ -426,13 +447,13 @@ class TestERP5BankingUsualCashTransfer(TestERP5BankingMixin, ERP5TypeTestCase): Check that compution of inventory at vault counter is right after confirm and before deliver """ # check we have 0 banknote of 10000 currently - self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0) + self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0) # check we will have 5 banknotes of 10000 after deliver - self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) + self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) # check we have 0 coin of 200 currently - self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) + self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) # check we will have 12 coins of 200 after deliver - self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0) + self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0) def stepDeliverUsualCashTransfer(self, sequence=None, sequence_list=None, **kwd): @@ -471,11 +492,11 @@ class TestERP5BankingUsualCashTransfer(TestERP5BankingMixin, ERP5TypeTestCase): Check inventory at destination (vault counter) after deliver of the cash transfer """ # check we have 5 banknotes of 10000 - self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) - self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) + self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) + self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) # check we have 12 coins of 200 - self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0) - self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0) + self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0) + self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter_final_vault.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0) ################################## diff --git a/product/ERP5Banking/tests/testERP5BankingVaultTransfer.py b/product/ERP5Banking/tests/testERP5BankingVaultTransfer.py index 17cda5d311..8fe75d8dd6 100644 --- a/product/ERP5Banking/tests/testERP5BankingVaultTransfer.py +++ b/product/ERP5Banking/tests/testERP5BankingVaultTransfer.py @@ -261,6 +261,7 @@ class TestERP5BankingVaultTransfer(TestERP5BankingMixin, ERP5TypeTestCase): self.vault_transfer = self.vault_transfer_module.newContent(id='vault_transfer_1', portal_type='Vault Transfer', source=self.usual_cash.getRelativeUrl(), + description='test', destination=self.caisse_courante.getRelativeUrl(), source_total_asset_price=52400.0) # execute tic self.stepTic() -- 2.30.9