Commit e3ee5996 authored by Sebastien Robin's avatar Sebastien Robin

many changes in order to take into account the new design of check and checkbooks

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14585 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 90e260fb
......@@ -309,6 +309,7 @@ class TestERP5BankingMixin:
def createCurrency(self, id='EUR', title='Euro'):
# create the currency document for euro inside the currency module
currency = self.getCurrencyModule().newContent(id=id, title=title, reference=id)
exchange_line = None
if id=='USD':
# Create an exchange line
exchange_line = currency.newContent(portal_type='Currency Exchange Line',
......@@ -338,6 +339,10 @@ class TestERP5BankingMixin:
for cell in cell_list:
cell.setBasePrice(1./650.0)
if exchange_line is not None:
exchange_line.confirm()
exchange_line.validate()
return currency
......@@ -804,6 +809,7 @@ class TestERP5BankingMixin:
model = self.checkbook_model_module.newContent(id = id,
portal_type = 'Checkbook Model',
title='Generic',
account_number_enabled=True,
composition=check_model.getRelativeUrl())
model.newContent(id='variant_1',portal_type='Checkbook Model Check Amount Variation',
quantity=50,title='50')
......@@ -822,6 +828,7 @@ class TestERP5BankingMixin:
portal_type = 'Check Model',
title = 'Check',
reference = reference,
account_number_enabled=True,
)
def createCheckAndCheckbookModel(self):
......
......@@ -135,6 +135,7 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
# the checkbook module
self.checkbook_module = self.getCheckbookModule()
self.createCheckAndCheckbookModel()
# create a check
self.checkbook_1 = self.createCheckbook(id= 'checkbook_1',
vault=None,
......@@ -145,6 +146,7 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
self.check_1 = self.createCheck(id='check_1',
reference='CHKNB1',
resource_value=self.check_model,
checkbook=self.checkbook_1)
......@@ -205,13 +207,15 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
"""
Add a check to the check deposit
"""
self.check_operation_line_1 = self.check_deposit.newContent(id='check_operation_line_1',
portal_type="Check Operation Line",
aggregate_free_text="CHKNB1",
source_payment_value = self.bank_account_2,
price=2000,
quantity=1,
quantity_unit_value=self.unit)
self.check_operation_line_1 = self.check_deposit.newContent(
id='check_operation_line_1',
portal_type="Check Operation Line",
aggregate_free_text="CHKNB1",
aggregate_resource=self.check_model.getRelativeUrl(),
source_payment_value = self.bank_account_2,
price=2000,
quantity=1,
quantity_unit_value=self.unit)
self.assertNotEqual(self.check_operation_line_1, None)
self.assertEqual(len(self.check_deposit.objectIds()), 1)
......@@ -221,13 +225,15 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
Add a check to the check deposit, check number is not defined into site
so transition must failed
"""
self.check_operation_line_1 = self.check_deposit.newContent(id='check_operation_line_1',
portal_type="Check Operation Line",
aggregate_free_text="CHKNB6",
source_payment_value = self.bank_account_2,
price=2000,
quantity=1,
quantity_unit_value=self.unit)
self.check_operation_line_1 = self.check_deposit.newContent(
id='check_operation_line_1',
portal_type="Check Operation Line",
aggregate_free_text="CHKNB6",
aggregate_resource=self.check_model.getRelativeUrl(),
source_payment_value = self.bank_account_2,
price=2000,
quantity=1,
quantity_unit_value=self.unit)
self.assertNotEqual(self.check_operation_line_1, None)
self.assertEqual(len(self.check_deposit.objectIds()), 1)
......@@ -294,11 +300,13 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
def stepClearCheck(self, sequence=None, sequence_list=None, **kw):
"""
Remove previous check and create a new one with same reference
Remove previous check and create a new one with same reference,
like this we make sure the workflow history is empty
"""
self.checkbook_1.manage_delObjects([self.check_1.getId(),])
self.check_1 = self.createCheck(id='check_1',
reference='CHKNB1',
resource_value=self.check_model,
checkbook=self.checkbook_1)
def stepClearCheckDepositModule(self, sequence=None, sequence_list=None, **kw):
......
......@@ -84,8 +84,7 @@ class TestERP5BankingCheckbookDeliveryMixin:
self.createManagerAndLogin()
self.createFunctionGroupSiteCategory()
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1')
self.check_model_1 = self.createCheckModel('check_model_1')
self.createCheckAndCheckbookModel()
self.createBanknotesAndCoins()
self.vault_transfer_source_site = self.paris.caveau
self.vault_transfer_destination_site = self.paris.surface
......@@ -218,7 +217,7 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin,
# Add a line for check and checkbook
self.line_1 = self.checkbook_delivery.newContent(quantity=1,
resource_value=self.checkbook_model_1,
check_amount_value=self.checkbook_model_1.variant_1,
check_amount_value=self.checkbook_model.variant_1,
reference_range_min=1,
description='test',
reference_range_max=50,
......
......@@ -86,8 +86,7 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi
self.createManagerAndLogin()
self.createFunctionGroupSiteCategory(site_list=['paris','madrid'])
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1')
self.check_model_1 = self.createCheckModel('check_model_1')
self.createCheckAndCheckbookModel()
self.createBanknotesAndCoins()
self.reception_destination_site = self.paris
self.source_site = self.paris
......
......@@ -85,9 +85,7 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
self.createFunctionGroupSiteCategory()
self.createBanknotesAndCoins()
self.traveler_check_model = self.createTravelerCheckModel('traveler_check_model')
self.check_model_1 = self.createCheckModel('check_model_1')
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1',
check_model=self.check_model_1)
self.createCheckAndCheckbookModel()
self.reception = self.paris.caveau.auxiliaire.encaisse_des_billets_et_monnaies
self.destination_site = self.paris
self.checkUserFolderType()
......
......@@ -78,9 +78,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin(
wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_action',
wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_action',
wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_to_deliver_action',
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_to_deliver_action',
wf_id='checkbook_vault_transfer_workflow')
def createCheckbookVaultTransferWithTravelerCheck(self, sequence=None,
......@@ -106,9 +104,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin(
wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_action',
wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_action',
wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_to_deliver_action',
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_to_deliver_action',
wf_id='checkbook_vault_transfer_workflow')
class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCashTransferMixin,
......@@ -150,8 +146,7 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas
self.createManagerAndLogin()
self.createFunctionGroupSiteCategory()
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1')
self.check_model_1 = self.createCheckModel('check_model_1')
self.createCheckAndCheckbookModel()
self.createBanknotesAndCoins()
self.vault_transfer_source_site = self.paris.caveau
self.vault_transfer_destination_site = self.paris.surface
......
......@@ -183,9 +183,7 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe
self.createManagerAndLogin()
self.createFunctionGroupSiteCategory()
self.check_model_1 = self.createCheckModel('check_model_1')
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1',
check_model=self.check_model_1)
self.createCheckAndCheckbookModel()
self.destination_site = self.paris
self.createBanknotesAndCoins()
self.reception_destination_site = self.paris
......
......@@ -129,6 +129,7 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin,
description='test',
start_date=self.date,
reference_range_min=51,
aggregate_resource_value=self.check_model_1,
source_total_asset_price=20000)
# set source reference
self.setDocumentSourceReference(self.stop_payment)
......
......@@ -118,8 +118,7 @@ class TestERP5BankingTravelerCheckSaleMixin:
self.createManagerAndLogin()
self.createFunctionGroupSiteCategory()
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1')
self.check_model_1 = self.createCheckModel('check_model_1')
self.createCheckAndCheckbookModel()
self.createBanknotesAndCoins()
self.vault_transfer_source_site = self.paris.caveau
self.vault_transfer_destination_site = self.paris.surface
......
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