Commit 6d27fcc7 authored by Vincent Pelletier's avatar Vincent Pelletier

Create a new checkbook model.

Chek that it is allowed to create checkbook reception with same reference range but different checkbook models.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22658 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5a55be1d
......@@ -906,6 +906,8 @@ class TestERP5BankingMixin:
self.checkbook_model = self.createCheckbookModel(
id='checkbook_model', check_model=self.check_model)
self.checkbook_model_1 = self.checkbook_model
self.checkbook_model_2 = self.createCheckbookModel(
id='checkbook_model_2', check_model=self.check_model)
def createCheck(self, id, reference, checkbook, bank_account=None,
resource_value=None, destination_value=None):
......
......@@ -180,6 +180,9 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
self.stepCreateCheckbookReception(id='checkbook_reception5',
imported=1)
def stepCreateCheckbookReception6(self, sequence=None, sequence_list=None, **kwd):
self.stepCreateCheckbookReception(id='checkbook_reception6')
def stepCreateCheckAndCheckbookLineList2(self, sequence=None, sequence_list=None, **kwd):
"""
Create the checkbook
......@@ -238,6 +241,23 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
reference_range_max='0000249',
)
def stepCreateCheckAndCheckbookLineList6(self, sequence=None, sequence_list=None, **kwd):
"""
Create the checkbook
"""
# This is not required to create checkbook items, they will be
# automatically created with the confirm action worfklow transition
# Add a line for check and checkbook
self.line_1 = self.checkbook_reception6.newContent(quantity=1,
resource_value=self.checkbook_model_2,
check_amount_value=self.checkbook_model_2.variant_1,
destination_payment_value=self.bank_account_1,
reference_range_min='0000200',
reference_range_max='0000249',
)
def stepCreateCheckAndCheckbookLineList(self, sequence=None, sequence_list=None, **kwd):
"""
Create the checkbook
......@@ -331,6 +351,14 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
wf_id='checkbook_reception_workflow')
self.assertEqual(self.checkbook_reception5.getSimulationState(), 'confirmed')
def stepConfirmCheckbookReception6(self, sequence=None, sequence_list=None, **kwd):
"""
confirm the monetary reception
"""
self.workflow_tool.doActionFor(self.checkbook_reception6, 'confirm_action',
wf_id='checkbook_reception_workflow')
self.assertEqual(self.checkbook_reception6.getSimulationState(), 'confirmed')
def stepDeliverCheckbookReception2Fails(self, sequence=None, sequence_list=None, **kwd):
"""
confirm the monetary reception
......@@ -367,6 +395,14 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
wf_id='checkbook_reception_workflow')
self.assertEqual(self.checkbook_reception3.getSimulationState(), 'delivered')
def stepDeliverCheckbookReception6(self, sequence=None, sequence_list=None, **kwd):
"""
confirm the monetary reception
"""
self.workflow_tool.doActionFor(self.checkbook_reception6, 'deliver_action',
wf_id='checkbook_reception_workflow')
self.assertEqual(self.checkbook_reception6.getSimulationState(), 'delivered')
def stepDeliverCheckbookReception(self, sequence=None, sequence_list=None, **kw):
"""
Deliver the monetary reception
......@@ -465,6 +501,13 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'CheckConfirmedCheckbookForImport Tic '
sequence_list.addSequenceString(sequence_string)
# Check that it is possible to have 2 receptions on the same range for 2 different checkbook models
sequence_string = 'Tic ' \
+ 'CreateCheckbookReception6 Tic ' \
+ 'CreateCheckAndCheckbookLineList6 Tic ' \
+ 'ConfirmCheckbookReception6 Tic ' \
+ 'DeliverCheckbookReception6 Tic'
sequence_list.addSequenceString(sequence_string)
# play the sequence
sequence_list.play(self)
......
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