Commit a4e6a22c authored by Grégory Wisniewski's avatar Grégory Wisniewski

Update ERP5Banking tests after r36763.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36817 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 39719b16
...@@ -899,27 +899,31 @@ class TestERP5BankingMixin(ERP5TypeTestCase): ...@@ -899,27 +899,31 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
""" """
if date is None: if date is None:
date = DateTime().Date() date = DateTime().Date()
return self.checkbook_module.newContent(id = id, return self.checkbook_module.newContent(
portal_type = 'Checkbook', id=id,
destination_value = vault, portal_type='Checkbook',
destination_payment_value = bank_account, destination_value=vault,
reference_range_min = min, destination_payment_value=bank_account,
reference_range_max = max, reference_range_min=min,
start_date = date) reference_range_max=max,
start_date=date,
)
def createCheckbookModel(self, id, check_model, reference=None, version=1): def createCheckbookModel(self, id, check_model, reference=None,
unique_per_reference=True):
""" """
Create a checkbook for the given bank account Create a checkbook for the given bank account
with 3 variations with 3 variations
""" """
unique_per_account = version == 1 model = self.checkbook_model_module.newContent(
model = self.checkbook_model_module.newContent(id = id, id=id,
portal_type = 'Checkbook Model', portal_type='Checkbook Model',
title='Generic', title='Generic',
account_number_enabled=True, account_number_enabled=True,
unique_per_account=unique_per_account, reference=reference,
reference=reference, composition=check_model.getRelativeUrl(),
composition=check_model.getRelativeUrl()) unique_per_reference=unique_per_reference,
)
model.newContent(id='variant_1', portal_type='Checkbook Model Check Amount Variation', model.newContent(id='variant_1', portal_type='Checkbook Model Check Amount Variation',
quantity=50, title='50') quantity=50, title='50')
model.newContent(id='variant_2', portal_type='Checkbook Model Check Amount Variation', model.newContent(id='variant_2', portal_type='Checkbook Model Check Amount Variation',
...@@ -929,18 +933,18 @@ class TestERP5BankingMixin(ERP5TypeTestCase): ...@@ -929,18 +933,18 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
return model return model
def createCheckModel(self, id, reference='CCOP', version=1): def createCheckModel(self, id, reference='CCOP', **kw):
""" """
Create a checkbook for the given bank account Create a checkbook for the given bank account
""" """
unique_per_account = version == 1 return self.checkbook_model_module.newContent(
return self.checkbook_model_module.newContent(id = id, id=id,
portal_type = 'Check Model', portal_type='Check Model',
title = 'Check', title='Check',
reference = reference, reference=reference,
account_number_enabled=True, account_number_enabled=True,
unique_per_account=unique_per_account unique_per_reference=True,
) )
def createCheckAndCheckbookModel(self): def createCheckAndCheckbookModel(self):
""" """
...@@ -951,13 +955,13 @@ class TestERP5BankingMixin(ERP5TypeTestCase): ...@@ -951,13 +955,13 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
self.check_model_2 = self.createCheckModel(id='check_model_2', reference='CCCO') self.check_model_2 = self.createCheckModel(id='check_model_2', reference='CCCO')
self.check_model_1_2 = self.createCheckModel( self.check_model_1_2 = self.createCheckModel(
id='check_model_1_2', id='check_model_1_2',
reference='CCOP2', reference='CCOP',
version=2, unique_per_reference=False,
) )
self.check_model_2_2 = self.createCheckModel( self.check_model_2_2 = self.createCheckModel(
id='check_model_2_2', id='check_model_2_2',
reference='CCCO2', reference='CCCO',
version=2, unique_per_reference=False,
) )
self.checkbook_model = self.createCheckbookModel( self.checkbook_model = self.createCheckbookModel(
id='checkbook_model', check_model=self.check_model) id='checkbook_model', check_model=self.check_model)
...@@ -967,12 +971,12 @@ class TestERP5BankingMixin(ERP5TypeTestCase): ...@@ -967,12 +971,12 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
self.checkbook_model_1_2 = self.createCheckbookModel( self.checkbook_model_1_2 = self.createCheckbookModel(
id='checkbook_model_1_2', id='checkbook_model_1_2',
check_model=self.check_model_1_2, check_model=self.check_model_1_2,
version=2, unique_per_reference=False,
) )
self.checkbook_model_2_2 = self.createCheckbookModel( self.checkbook_model_2_2 = self.createCheckbookModel(
id='checkbook_model_2_2', id='checkbook_model_2_2',
check_model=self.check_model_2_2, check_model=self.check_model_2_2,
version=2, unique_per_reference=False,
) )
def createCheck(self, id, reference, checkbook, bank_account=None, def createCheck(self, id, reference, checkbook, bank_account=None,
......
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