Commit 5e707f5d authored by Sebastien Robin's avatar Sebastien Robin

check many worklists, also fix problem of vault in cash balance regulation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16604 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 84109d45
...@@ -1120,3 +1120,23 @@ class TestERP5BankingMixin: ...@@ -1120,3 +1120,23 @@ class TestERP5BankingMixin:
to_delete_id_list = [x for x in inventory_module.objectIds() to_delete_id_list = [x for x in inventory_module.objectIds()
if x.find('reset')>=0] if x.find('reset')>=0]
inventory_module.manage_delObjects(ids=to_delete_id_list) inventory_module.manage_delObjects(ids=to_delete_id_list)
def checkWorklist(self, document):
"""
"""
document.portal_caches.clearAllCache()
portal_type = document.getPortalType()
state = document.getSimulationState()
workflow_id = '%s_workflow' % portal_type.lower().replace(' ', '_')
actions = self.getPortal().portal_actions.listFilteredActionsFor(document)
found = 0
for action in actions['global']:
if action.get('workflow_id', None) == workflow_id:
url = action.get('url', None)
if url is not None:
if url.find(state)>=0 and url.find(portal_type)>=0:
found = 1
if not found:
import pdb; pdb.set_trace()
self.assertEquals(found, 1)
...@@ -136,7 +136,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas ...@@ -136,7 +136,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas
self.guichet_1 = self.paris.surface.banque_interne.guichet_1.encaisse_des_billets_et_monnaies self.guichet_1 = self.paris.surface.banque_interne.guichet_1.encaisse_des_billets_et_monnaies
self.createCashInventory(source=self.guichet_1, destination=self.guichet_1, currency=self.currency_1, line_list=line_list) self.createCashInventory(source=self.guichet_1, destination=self.guichet_1, currency=self.currency_1, line_list=line_list)
self.guichet_caveau = self.paris.caveau.serre.encaisse_des_billets_retires_de_la_circulation self.guichet_caveau = self.paris.caveau.auxiliaire.encaisse_des_billets_et_monnaies
self.createCashInventory(source=self.guichet_caveau, destination=self.guichet_caveau, currency=self.currency_1, line_list=line_list) self.createCashInventory(source=self.guichet_caveau, destination=self.guichet_caveau, currency=self.currency_1, line_list=line_list)
self.guichet_salletri = self.paris.surface.salle_tri.encaisse_des_billets_et_monnaies self.guichet_salletri = self.paris.surface.salle_tri.encaisse_des_billets_et_monnaies
...@@ -278,7 +278,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas ...@@ -278,7 +278,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas
self.assertEqual(len(self.cash_balance_regulation_module.objectValues()), 1) self.assertEqual(len(self.cash_balance_regulation_module.objectValues()), 1)
self.cash_balance_regulation = getattr(self.cash_balance_regulation_module, 'cash_balance_regulation_1') self.cash_balance_regulation = getattr(self.cash_balance_regulation_module, 'cash_balance_regulation_1')
self.assertEqual(self.cash_balance_regulation.getPortalType(), 'Cash Balance Regulation') self.assertEqual(self.cash_balance_regulation.getPortalType(), 'Cash Balance Regulation')
self.assertEqual(self.cash_balance_regulation.getSource(), 'site/testsite/paris/caveau/serre/encaisse_des_billets_retires_de_la_circulation') self.assertEqual(self.cash_balance_regulation.getSource(), 'site/testsite/paris/caveau/auxiliaire/encaisse_des_billets_et_monnaies')
self.assertEqual(self.cash_balance_regulation.getDestination(), None) self.assertEqual(self.cash_balance_regulation.getDestination(), None)
def stepCreateCashBalanceRegulationSalleTri(self, sequence=None, sequence_list=None, **kwd): def stepCreateCashBalanceRegulationSalleTri(self, sequence=None, sequence_list=None, **kwd):
...@@ -696,7 +696,8 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas ...@@ -696,7 +696,8 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.cash_balance_regulation)
def stepDelCashBalanceRegulation(self, sequence=None, sequence_list=None, **kwd): def stepDelCashBalanceRegulation(self, sequence=None, sequence_list=None, **kwd):
""" """
...@@ -723,8 +724,10 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas ...@@ -723,8 +724,10 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas
+ 'CreateValidOutgoingLine ' \ + 'CreateValidOutgoingLine ' \
+ 'Tic CheckTotal ' \ + 'Tic CheckTotal ' \
+ 'CheckInitialInventory ' \ + 'CheckInitialInventory ' \
+ 'Tic CheckWorklist ' \
+ 'ConfirmCashBalanceRegulation Tic ' \ + 'ConfirmCashBalanceRegulation Tic ' \
+ 'CheckConfirmedInventory ' \ + 'CheckConfirmedInventory ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashBalanceRegulation Tic ' \ + 'DeliverCashBalanceRegulation Tic ' \
+ 'CheckFinalInventory' + 'CheckFinalInventory'
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
...@@ -736,8 +739,10 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas ...@@ -736,8 +739,10 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas
+ 'CreateValidOutgoingLine ' \ + 'CreateValidOutgoingLine ' \
+ 'Tic CheckTotal ' \ + 'Tic CheckTotal ' \
+ 'CheckInitialInventoryCaveau ' \ + 'CheckInitialInventoryCaveau ' \
+ 'Tic CheckWorklist ' \
+ 'ConfirmCashBalanceRegulation Tic ' \ + 'ConfirmCashBalanceRegulation Tic ' \
+ 'CheckConfirmedInventoryCaveau ' \ + 'CheckConfirmedInventoryCaveau ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashBalanceRegulation Tic ' \ + 'DeliverCashBalanceRegulation Tic ' \
+ 'CheckFinalInventoryCaveau' + 'CheckFinalInventoryCaveau'
sequence_list.addSequenceString(sequence_caveau) sequence_list.addSequenceString(sequence_caveau)
...@@ -750,6 +755,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas ...@@ -750,6 +755,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas
+ 'CheckInitialInventorySalleTri ' \ + 'CheckInitialInventorySalleTri ' \
+ 'ConfirmCashBalanceRegulation Tic ' \ + 'ConfirmCashBalanceRegulation Tic ' \
+ 'CheckConfirmedInventorySalleTri ' \ + 'CheckConfirmedInventorySalleTri ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashBalanceRegulation Tic ' \ + 'DeliverCashBalanceRegulation Tic ' \
+ 'CheckFinalInventorySalleTri' + 'CheckFinalInventorySalleTri'
sequence_list.addSequenceString(sequence_salletri) sequence_list.addSequenceString(sequence_salletri)
...@@ -762,6 +768,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas ...@@ -762,6 +768,7 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin, ERP5TypeTestCas
+ 'CheckInitialInventorySurface ' \ + 'CheckInitialInventorySurface ' \
+ 'ConfirmCashBalanceRegulation Tic ' \ + 'ConfirmCashBalanceRegulation Tic ' \
+ 'CheckConfirmedInventorySurface ' \ + 'CheckConfirmedInventorySurface ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashBalanceRegulation Tic ' \ + 'DeliverCashBalanceRegulation Tic ' \
+ 'CheckFinalInventorySurface' + 'CheckFinalInventorySurface'
sequence_list.addSequenceString(sequence_surface) sequence_list.addSequenceString(sequence_surface)
......
...@@ -704,6 +704,8 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -704,6 +704,8 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_aux_externe.getRelativeUrl(), resource = self.billet_100.getRelativeUrl()), 10.0) self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_aux_externe.getRelativeUrl(), resource = self.billet_100.getRelativeUrl()), 10.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.encaisse_aux_externe.getRelativeUrl(), resource = self.billet_100.getRelativeUrl()), 10.0) self.assertEqual(self.simulation_tool.getFutureInventory(node=self.encaisse_aux_externe.getRelativeUrl(), resource = self.billet_100.getRelativeUrl()), 10.0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.cash_sorting)
################################## ##################################
## Tests ## Tests
...@@ -725,7 +727,9 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -725,7 +727,9 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'CreateValidOutgoingLineForMixed ' \ + 'CreateValidOutgoingLineForMixed ' \
+ 'Tic CheckTotal ' \ + 'Tic CheckTotal ' \
+ 'CheckSource CheckDestination ' \ + 'CheckSource CheckDestination ' \
+ 'Tic CheckWorklist ' \
+ 'ConfirmCashSorting Tic ' \ + 'ConfirmCashSorting Tic ' \
+ 'Tic CheckWorklist ' \
+ 'CheckSourceDebitPlanned CheckDestinationCreditPlanned ' \ + 'CheckSourceDebitPlanned CheckDestinationCreditPlanned ' \
+ 'DeliverCashSorting Tic ' \ + 'DeliverCashSorting Tic ' \
+ 'CheckSourceDebit CheckDestinationCredit ' + 'CheckSourceDebit CheckDestinationCredit '
......
...@@ -498,6 +498,9 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -498,6 +498,9 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin, ERP5TypeTestCase):
'cash_exchange_workflow','deliver_action') 'cash_exchange_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0) self.failUnless(message.find('Insufficient balance')>=0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.cash_exchange)
################################## ##################################
## Tests ## Tests
...@@ -520,6 +523,7 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -520,6 +523,7 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'ResetInventory Tic ' \ + 'ResetInventory Tic ' \
+ 'DeliverFails Tic ' \ + 'DeliverFails Tic ' \
+ 'DeleteResetInventory Tic ' \ + 'DeleteResetInventory Tic ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashExchange Tic ' \ + 'DeliverCashExchange Tic ' \
+ 'CheckFinalInventoryGuichet_1 ' \ + 'CheckFinalInventoryGuichet_1 ' \
+ 'CheckFinalInventoryGuichet_2' + 'CheckFinalInventoryGuichet_2'
......
...@@ -143,10 +143,14 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -143,10 +143,14 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
self.line_list = line_list = [inventory_dict_line_1, inventory_dict_line_2] self.line_list = line_list = [inventory_dict_line_1, inventory_dict_line_2]
self.vault_source = self.paris.caveau.auxiliaire.encaisse_des_externes self.vault_source = self.paris.caveau.auxiliaire.encaisse_des_externes
self.currency_handover_vault_source = self.paris.caveau.auxiliaire.encaisse_des_devises.usd
self.vault_destination = self.madrid.caveau.reserve.encaisse_des_billets_et_monnaies self.vault_destination = self.madrid.caveau.reserve.encaisse_des_billets_et_monnaies
self.createCashInventory(source=None, destination=self.vault_source, currency=self.currency_1, self.createCashInventory(source=None, destination=self.vault_source, currency=self.currency_1,
line_list=line_list) line_list=line_list)
self.createCashInventory(source=None, destination=self.currency_handover_vault_source,
currency=self.currency_1,
line_list=line_list)
# Create an Organisation that will be used for users assignment # Create an Organisation that will be used for users assignment
self.checkUserFolderType() self.checkUserFolderType()
self.organisation = self.organisation_module.newContent(id='baobab_org', portal_type='Organisation', self.organisation = self.organisation_module.newContent(id='baobab_org', portal_type='Organisation',
...@@ -195,6 +199,24 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -195,6 +199,24 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.vault_destination.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.vault_destination.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.vault_destination.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getFutureInventory(node=self.vault_destination.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
def stepCheckCurrencyHandoverInitialInventory(self, sequence=None, sequence_list=None, **kwd):
"""
Check the initial inventory before any operations
"""
self.simulation_tool = self.getSimulationTool()
# check we have 5 banknotes of 10000 in vault_source
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
# check we have 12 coin of 200 in vault_source
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
# check we don't have banknotes of 10000
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.vault_destination.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.vault_destination.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
# check we don't have coins of 200
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.vault_destination.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.vault_destination.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
def stepCreateCashMovement(self, sequence=None, sequence_list=None, def stepCreateCashMovement(self, sequence=None, sequence_list=None,
none_destination=0, **kwd): none_destination=0, **kwd):
""" """
...@@ -258,6 +280,9 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -258,6 +280,9 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
# check the banknote of the cell is banknote of 10000 # check the banknote of the cell is banknote of 10000
self.assertEqual(cell.getResourceValue(), self.billet_10000) self.assertEqual(cell.getResourceValue(), self.billet_10000)
# check the source vault is vault_source # check the source vault is vault_source
if cell.getExplanationValue().isCurrencyHandover():
self.assertEqual(cell.getSourceValue(), self.currency_handover_vault_source)
else:
self.assertEqual(cell.getSourceValue(), self.vault_source) self.assertEqual(cell.getSourceValue(), self.vault_source)
# check the destination vault is vault_destination # check the destination vault is vault_destination
if cell.getId() == 'movement_0_0_0': if cell.getId() == 'movement_0_0_0':
...@@ -482,6 +507,19 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -482,6 +507,19 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
# check we will have 0 coin of 200 after deliver # check we will have 0 coin of 200 after deliver
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getFutureInventory(node=self.vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
def stepCheckCurrencyHandoverSourceDebitStarted(self, sequence=None, sequence_list=None, **kwd):
"""
Check that computaion of inventory at vault vault_source is right after start and before stop
"""
# check we have 0 banknotes of 10000 currently
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
# check we will have 0 banknote of 10000 after deliver
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
# check we have 0 coins of 200 currently
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
# check we will have 0 coin of 200 after deliver
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
def stepCheckDestinationCreditStarted(self, sequence=None, sequence_list=None, **kwd): def stepCheckDestinationCreditStarted(self, sequence=None, sequence_list=None, **kwd):
""" """
Check that compution of inventory at vault vault_destination is right after start and before stop Check that compution of inventory at vault vault_destination is right after start and before stop
...@@ -516,6 +554,7 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -516,6 +554,7 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
def stepSetCashMovementCurrencyHandover(self, sequence=None, sequence_list=None, **kwd): def stepSetCashMovementCurrencyHandover(self, sequence=None, sequence_list=None, **kwd):
self.cash_movement.setCurrencyHandover(True) self.cash_movement.setCurrencyHandover(True)
self.cash_movement.setDestination(None) self.cash_movement.setDestination(None)
self.cash_movement.setSourceValue(self.currency_handover_vault_source)
def stepDeliverCashMovement(self, sequence=None, sequence_list=None, **kwd): def stepDeliverCashMovement(self, sequence=None, sequence_list=None, **kwd):
""" """
...@@ -543,7 +582,16 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -543,7 +582,16 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getFutureInventory(node=self.vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
def stepCheckCurrencyHandoverSourceDebit(self, sequence=None, sequence_list=None, **kwd):
"""
Check inventory at source (vault vault_source) after deliver of the cash_movement
"""
# check we have 0 banknote of 10000
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
# check we have 0 coin of 200
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.currency_handover_vault_source.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
def stepCheckDestinationCredit(self, sequence=None, sequence_list=None, **kwd): def stepCheckDestinationCredit(self, sequence=None, sequence_list=None, **kwd):
""" """
...@@ -588,6 +636,9 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -588,6 +636,9 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
'cash_movement_workflow','start_action') 'cash_movement_workflow','start_action')
self.failUnless(message.find('Insufficient balance')>=0) self.failUnless(message.find('Insufficient balance')>=0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.cash_movement)
def test_01_ERP5BankingCashMovement(self, quiet=QUIET, run=RUN_ALL_TEST): def test_01_ERP5BankingCashMovement(self, quiet=QUIET, run=RUN_ALL_TEST):
""" """
...@@ -602,14 +653,18 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -602,14 +653,18 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'CreateValidLine2 CheckTotal ' \ + 'CreateValidLine2 CheckTotal ' \
+ 'CheckInitialInventory ' \ + 'CheckInitialInventory ' \
+ 'CreateInvalidLine ' \ + 'CreateInvalidLine ' \
+ 'Tic CheckWorklist ' \
+ 'TryConfirmCashMovementWithBadInventory ' \ + 'TryConfirmCashMovementWithBadInventory ' \
+ 'DelInvalidLine Tic CheckTotal ' \ + 'DelInvalidLine Tic CheckTotal ' \
+ 'ConfirmCashMovement ' \ + 'ConfirmCashMovement ' \
+ 'ResetSourceInventory Tic ' \ + 'ResetSourceInventory Tic ' \
+ 'Tic CheckWorklist ' \
+ 'StartCashMovementFails DeleteResetInventory Tic ' \ + 'StartCashMovementFails DeleteResetInventory Tic ' \
+ 'StartCashMovement ' \ + 'StartCashMovement ' \
+ 'Tic CheckWorklist ' \
+ 'CheckSourceDebitStarted CheckDestinationCreditStarted ' \ + 'CheckSourceDebitStarted CheckDestinationCreditStarted ' \
+ 'StopCashMovement ' \ + 'StopCashMovement ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashMovement ' \ + 'DeliverCashMovement ' \
+ 'CheckSourceDebit CheckDestinationCredit ' + 'CheckSourceDebit CheckDestinationCredit '
...@@ -617,19 +672,24 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -617,19 +672,24 @@ class TestERP5BankingCashMovement(TestERP5BankingMixin, ERP5TypeTestCase):
# Another sequence in order to test that the currency handover # Another sequence in order to test that the currency handover
# is working # is working
sequence_string = 'Tic DelCashMovement Tic CheckInitialInventory ' \ sequence_string = 'Tic DelCashMovement Tic CheckCurrencyHandoverInitialInventory ' \
+ 'CreateCashMovement ' \ + 'CreateCashMovement ' \
+ 'SetCashMovementCurrencyHandover ' \ + 'SetCashMovementCurrencyHandover ' \
+ 'CreateValidLine1 CheckSubTotal ' \ + 'CreateValidLine1 CheckSubTotal ' \
+ 'CreateValidLine2 CheckTotal ' \ + 'CreateValidLine2 CheckTotal ' \
+ 'CheckInitialInventory ' \ + 'CheckCurrencyHandoverInitialInventory ' \
+ 'Tic CheckTotal ' \ + 'Tic CheckTotal ' \
+ 'Tic CheckWorklist ' \
+ 'ConfirmCashMovement ' \ + 'ConfirmCashMovement ' \
+ 'Tic CheckWorklist ' \
+ 'StartCashMovement ' \ + 'StartCashMovement ' \
+ 'CheckSourceDebitStarted CheckDestinationHasNotChanged ' \ + 'CheckCurrencyHandoverSourceDebitStarted ' \
+ 'CheckDestinationHasNotChanged ' \
+ 'Tic CheckWorklist ' \
+ 'StopCashMovement ' \ + 'StopCashMovement ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashMovement ' \ + 'DeliverCashMovement ' \
+ 'CheckSourceDebit CheckDestinationHasNotChanged ' + 'CheckCurrencyHandoverSourceDebit CheckDestinationHasNotChanged '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
......
...@@ -602,6 +602,8 @@ class TestERP5BankingCashSorting(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -602,6 +602,8 @@ class TestERP5BankingCashSorting(TestERP5BankingMixin, ERP5TypeTestCase):
'cash_sorting_workflow','deliver_action') 'cash_sorting_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0) self.failUnless(message.find('Insufficient balance')>=0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.cash_sorting)
################################## ##################################
## Tests ## Tests
...@@ -621,9 +623,11 @@ class TestERP5BankingCashSorting(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -621,9 +623,11 @@ class TestERP5BankingCashSorting(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'CreateValidOutgoingLineForExternalBanknote ' \ + 'CreateValidOutgoingLineForExternalBanknote ' \
+ 'CreateValidOutgoingLineForInternalAndCancelledBanknote Tic CheckTotal ' \ + 'CreateValidOutgoingLineForInternalAndCancelledBanknote Tic CheckTotal ' \
+ 'CheckSource CheckDestination ' \ + 'CheckSource CheckDestination ' \
+ 'Tic CheckWorklist ' \
+ 'ConfirmCashSorting Tic ' \ + 'ConfirmCashSorting Tic ' \
+ 'CheckSourceDebitPlanned CheckDestinationCreditPlanned ' \ + 'CheckSourceDebitPlanned CheckDestinationCreditPlanned ' \
+ 'ResetSourceInventory Tic ' \ + 'ResetSourceInventory Tic ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashSortingFails Tic ' \ + 'DeliverCashSortingFails Tic ' \
+ 'DeleteResetInventory Tic ' \ + 'DeleteResetInventory Tic ' \
+ 'DeliverCashSorting Tic ' \ + 'DeliverCashSorting Tic ' \
......
...@@ -444,15 +444,14 @@ class TestERP5BankingCashToCurrencyPurchase(TestERP5BankingMixin, ERP5TypeTestCa ...@@ -444,15 +444,14 @@ class TestERP5BankingCashToCurrencyPurchase(TestERP5BankingMixin, ERP5TypeTestCa
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.guichet_sortante.getRelativeUrl(), resource = self.piece_100.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.guichet_sortante.getRelativeUrl(), resource = self.piece_100.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.guichet_sortante.getRelativeUrl(), resource = self.piece_100.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getFutureInventory(node=self.guichet_sortante.getRelativeUrl(), resource = self.piece_100.getRelativeUrl()), 0.0)
def stepDelCashToCurrencyPurchase(self, sequence=None, sequence_list=None, **kwd): def stepDelCashToCurrencyPurchase(self, sequence=None, sequence_list=None, **kwd):
""" """
Delete the invalid vault_transfer line previously create Delete the invalid vault_transfer line previously create
""" """
self.cash_to_currency_purchase_module.deleteContent('cash_to_currency_purchase_1') self.cash_to_currency_purchase_module.deleteContent('cash_to_currency_purchase_1')
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.cash_to_currency_purchase)
################################## ##################################
## Tests ## Tests
...@@ -471,6 +470,7 @@ class TestERP5BankingCashToCurrencyPurchase(TestERP5BankingMixin, ERP5TypeTestCa ...@@ -471,6 +470,7 @@ class TestERP5BankingCashToCurrencyPurchase(TestERP5BankingMixin, ERP5TypeTestCa
+ 'CreateValidIncomingLine CheckSubTotal ' \ + 'CreateValidIncomingLine CheckSubTotal ' \
+ 'CreateValidOutgoingLine ' \ + 'CreateValidOutgoingLine ' \
+ 'Tic CheckTotal ' \ + 'Tic CheckTotal ' \
+ 'Tic CheckWorklist ' \
+ 'DeliverCashToCurrencyPurchase Tic ' \ + 'DeliverCashToCurrencyPurchase Tic ' \
+ 'CheckFinalInventoryGuichet_Entrante ' \ + 'CheckFinalInventoryGuichet_Entrante ' \
+ 'CheckFinalInventoryGuichet_Sortante' + 'CheckFinalInventoryGuichet_Sortante'
......
...@@ -411,6 +411,8 @@ class TestERP5BankingCashToCurrencySale(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -411,6 +411,8 @@ class TestERP5BankingCashToCurrencySale(TestERP5BankingMixin, ERP5TypeTestCase):
'cash_to_currency_sale_workflow','deliver_action') 'cash_to_currency_sale_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0) self.failUnless(message.find('Insufficient balance')>=0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.cash_to_currency_sale)
################################## ##################################
## Tests ## Tests
...@@ -432,6 +434,7 @@ class TestERP5BankingCashToCurrencySale(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -432,6 +434,7 @@ class TestERP5BankingCashToCurrencySale(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'ResetSourceInventory Tic ' \ + 'ResetSourceInventory Tic ' \
+ 'DeliverCashToCurrencySaleFails Tic ' \ + 'DeliverCashToCurrencySaleFails Tic ' \
+ 'DeleteResetInventory Tic ' \ + 'DeleteResetInventory Tic ' \
+ 'CheckWorklist Tic ' \
+ 'DeliverCashToCurrencySale Tic ' \ + 'DeliverCashToCurrencySale Tic ' \
+ 'CheckFinalInventoryGuichet_Entrante ' \ + 'CheckFinalInventoryGuichet_Entrante ' \
+ 'CheckFinalInventoryGuichet_Sortante' + 'CheckFinalInventoryGuichet_Sortante'
......
...@@ -474,6 +474,24 @@ class TestERP5BankingCheckPaymentMixin: ...@@ -474,6 +474,24 @@ class TestERP5BankingCheckPaymentMixin:
'check_payment_workflow','deliver_action') 'check_payment_workflow','deliver_action')
self.failUnless(message.find('Insufficient balance')>=0) self.failUnless(message.find('Insufficient balance')>=0)
def stepCheckCheckIsDelivered(self, sequence=None, sequence_list=None, **kwd):
"""
Make sure that the check is in delivered state
"""
check = self.check_payment.getAggregateValue()
self.assertEquals(check, self.check_1)
self.assertEquals(check.getSimulationState(), 'delivered')
def stepCheckUndeliverCheck(self, sequence=None, sequence_list=None, **kwd):
"""
Make sure that the check is in delivered state
"""
check = self.check_payment.getAggregateValue()
self.assertEquals(check, self.check_1)
self.workflow_tool.doActionFor(check, 'undeliver_action',
wf_id='check_workflow')
self.assertEquals(check.getSimulationState(), 'confirmed')
class TestERP5BankingCheckPayment(TestERP5BankingCheckPaymentMixin, class TestERP5BankingCheckPayment(TestERP5BankingCheckPaymentMixin,
TestERP5BankingMixin, ERP5TypeTestCase): TestERP5BankingMixin, ERP5TypeTestCase):
...@@ -501,6 +519,8 @@ class TestERP5BankingCheckPayment(TestERP5BankingCheckPaymentMixin, ...@@ -501,6 +519,8 @@ class TestERP5BankingCheckPayment(TestERP5BankingCheckPaymentMixin,
'PayCheckPaymentFails Tic ' \ 'PayCheckPaymentFails Tic ' \
'DeleteResetInventory Tic ' \ 'DeleteResetInventory Tic ' \
'Pay Tic ' \ 'Pay Tic ' \
'CheckCheckIsDelivered Tic ' \
'CheckUndeliverCheck Tic ' \
'CheckFinalInventory Cleanup Tic' 'CheckFinalInventory Cleanup Tic'
# sequence 2 : check if validating with non-exiting check fail if # sequence 2 : check if validating with non-exiting check fail if
# automatic check creation is disabled. # automatic check creation is disabled.
......
...@@ -280,6 +280,9 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin, ...@@ -280,6 +280,9 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin,
self.failUnless(message.find('Sorry, the item with reference')>=0) self.failUnless(message.find('Sorry, the item with reference')>=0)
self.failUnless(message.find('is not available any more')>=0) self.failUnless(message.find('is not available any more')>=0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.checkbook_delivery)
################################## ##################################
## Tests ## Tests
################################## ##################################
...@@ -297,6 +300,7 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin, ...@@ -297,6 +300,7 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin,
+ 'ChangePreviousDeliveryDate Tic ' \ + 'ChangePreviousDeliveryDate Tic ' \
+ 'DeliverCheckbookDeliveryFails Tic ' \ + 'DeliverCheckbookDeliveryFails Tic ' \
+ 'PutBackPreviousDeliveryDate Tic ' \ + 'PutBackPreviousDeliveryDate Tic ' \
+ 'CheckWorklist Tic ' \
+ 'DeliverCheckbookDelivery Tic ' \ + 'DeliverCheckbookDelivery Tic ' \
+ 'CheckFinalCheckbookInventory' + 'CheckFinalCheckbookInventory'
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
......
...@@ -314,6 +314,9 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi ...@@ -314,6 +314,9 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi
self.failUnless(message.find('Sorry, the item with reference')>=0) self.failUnless(message.find('Sorry, the item with reference')>=0)
self.failUnless(message.find('is not available any more')>=0) self.failUnless(message.find('is not available any more')>=0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.checkbook_movement)
################################## ##################################
## Tests ## Tests
################################## ##################################
...@@ -328,13 +331,17 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi ...@@ -328,13 +331,17 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi
sequence_string = 'Tic CheckObjects Tic CheckInitialCheckbookInventory ' \ sequence_string = 'Tic CheckObjects Tic CheckInitialCheckbookInventory ' \
+ 'CreateCheckbookMovement Tic ' \ + 'CreateCheckbookMovement Tic ' \
+ 'CreateCheckAndCheckbookLineList Tic ' \ + 'CreateCheckAndCheckbookLineList Tic ' \
+ 'CheckWorklist ' \
+ 'PlanCheckbookMovement Tic ' \ + 'PlanCheckbookMovement Tic ' \
+ 'CheckWorklist ' \
+ 'OrderCheckbookMovement Tic ' \ + 'OrderCheckbookMovement Tic ' \
+ 'CheckWorklist ' \
+ 'ConfirmCheckbookMovement Tic ' \ + 'ConfirmCheckbookMovement Tic ' \
+ 'CheckConfirmedCheckbookInventory Tic ' \ + 'CheckConfirmedCheckbookInventory Tic ' \
+ 'ChangePreviousDeliveryDate Tic ' \ + 'ChangePreviousDeliveryDate Tic ' \
+ 'DeliverCheckbookMovementFails Tic ' \ + 'DeliverCheckbookMovementFails Tic ' \
+ 'PutBackPreviousDeliveryDate Tic ' \ + 'PutBackPreviousDeliveryDate Tic ' \
+ 'CheckWorklist ' \
+ 'DeliverCheckbookMovement Tic ' \ + 'DeliverCheckbookMovement Tic ' \
+ 'CheckFinalCheckbookInventory' + 'CheckFinalCheckbookInventory'
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
......
...@@ -140,7 +140,7 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -140,7 +140,7 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
def stepCreateCheckbookReception(self, sequence=None, sequence_list=None, def stepCreateCheckbookReception(self, sequence=None, sequence_list=None,
id='checkbook_reception', **kwd): id='checkbook_reception', imported=0, **kwd):
""" """
Create a checkbook reception document and check it Create a checkbook reception document and check it
""" """
...@@ -150,15 +150,19 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -150,15 +150,19 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
source_value=None, destination_value=self.destination_site, source_value=None, destination_value=self.destination_site,
resource_value=self.currency_1, resource_value=self.currency_1,
description='test', description='test',
start_date=self.date) start_date=self.date,
imported=imported)
setattr(self, id, checkbook_reception) setattr(self, id, checkbook_reception)
# get the checkbook reception document # get the checkbook reception document
self.checkbook_reception = getattr(self.checkbook_reception_module, 'checkbook_reception') self.checkbook_reception = getattr(self.checkbook_reception_module, id)
# check its portal type # check its portal type
self.assertEqual(self.checkbook_reception.getPortalType(), 'Checkbook Reception') self.assertEqual(self.checkbook_reception.getPortalType(), 'Checkbook Reception')
# check that its source is caisse_1 # check that its source is caisse_1
self.assertEqual(self.checkbook_reception.getSource(), None) self.assertEqual(self.checkbook_reception.getSource(), None)
# check that its destination is caisse_2 # check that its destination is caisse_2
if imported:
self.assertEqual(self.checkbook_reception.getBaobabDestination(), None)
else:
self.assertEqual(self.checkbook_reception.getBaobabDestination(), self.assertEqual(self.checkbook_reception.getBaobabDestination(),
'site/testsite/paris/caveau/auxiliaire/encaisse_des_billets_et_monnaies') 'site/testsite/paris/caveau/auxiliaire/encaisse_des_billets_et_monnaies')
return self.checkbook_reception return self.checkbook_reception
...@@ -172,6 +176,10 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -172,6 +176,10 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
def stepCreateCheckbookReception4(self, sequence=None, sequence_list=None, **kwd): def stepCreateCheckbookReception4(self, sequence=None, sequence_list=None, **kwd):
self.stepCreateCheckbookReception(id='checkbook_reception4') self.stepCreateCheckbookReception(id='checkbook_reception4')
def stepCreateCheckbookReception5(self, sequence=None, sequence_list=None, **kwd):
self.stepCreateCheckbookReception(id='checkbook_reception5',
imported=1)
def stepCreateCheckAndCheckbookLineList2(self, sequence=None, sequence_list=None, **kwd): def stepCreateCheckAndCheckbookLineList2(self, sequence=None, sequence_list=None, **kwd):
""" """
Create the checkbook Create the checkbook
...@@ -214,6 +222,22 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -214,6 +222,22 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
reference_range_max='0000150', reference_range_max='0000150',
) )
def stepCreateCheckAndCheckbookLineList5(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_reception5.newContent(quantity=1,
resource_value=self.checkbook_model_1,
check_amount_value=self.checkbook_model_1.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): def stepCreateCheckAndCheckbookLineList(self, sequence=None, sequence_list=None, **kwd):
""" """
Create the checkbook Create the checkbook
...@@ -299,6 +323,14 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -299,6 +323,14 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
wf_id='checkbook_reception_workflow') wf_id='checkbook_reception_workflow')
self.assertEqual(self.checkbook_reception4.getSimulationState(), 'confirmed') self.assertEqual(self.checkbook_reception4.getSimulationState(), 'confirmed')
def stepConfirmCheckbookReception5(self, sequence=None, sequence_list=None, **kwd):
"""
confirm the monetary reception
"""
self.workflow_tool.doActionFor(self.checkbook_reception5, 'confirm_action',
wf_id='checkbook_reception_workflow')
self.assertEqual(self.checkbook_reception5.getSimulationState(), 'confirmed')
def stepDeliverCheckbookReception2Fails(self, sequence=None, sequence_list=None, **kwd): def stepDeliverCheckbookReception2Fails(self, sequence=None, sequence_list=None, **kwd):
""" """
confirm the monetary reception confirm the monetary reception
...@@ -327,6 +359,14 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -327,6 +359,14 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
>=0) >=0)
self.failUnless(msg.find('150')>=0) self.failUnless(msg.find('150')>=0)
def stepDeliverCheckbookReception5(self, sequence=None, sequence_list=None, **kwd):
"""
confirm the monetary reception
"""
self.workflow_tool.doActionFor(self.checkbook_reception5, 'deliver_action',
wf_id='checkbook_reception_workflow')
self.assertEqual(self.checkbook_reception3.getSimulationState(), 'delivered')
def stepDeliverCheckbookReception(self, sequence=None, sequence_list=None, **kw): def stepDeliverCheckbookReception(self, sequence=None, sequence_list=None, **kw):
""" """
Deliver the monetary reception Deliver the monetary reception
...@@ -358,6 +398,18 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -358,6 +398,18 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
self.failIfDifferentSet(checkbook_object_list,[self.checkbook_1,self.check_1]) self.failIfDifferentSet(checkbook_object_list,[self.checkbook_1,self.check_1])
self.assertEqual(len(self.simulation_tool.getFutureTrackingList(node=self.reception.getRelativeUrl())), 2) self.assertEqual(len(self.simulation_tool.getFutureTrackingList(node=self.reception.getRelativeUrl())), 2)
def stepCheckConfirmedCheckbookForImport(self, sequence=None, sequence_list=None, **kw):
"""
Check cash checkbook in item table
"""
checkbook = self.checkbook_reception5.objectValues()[0].getAggregateValue()
self.assertEqual(checkbook.getValidationState(), 'confirmed')
check = checkbook.objectValues()[0]
self.assertEqual(check.getSimulationState(), 'confirmed')
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.checkbook_reception)
################################## ##################################
## Tests ## Tests
################################## ##################################
...@@ -372,7 +424,9 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -372,7 +424,9 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
sequence_string = 'Tic CheckObjects Tic CheckInitialCheckbookInventory ' \ sequence_string = 'Tic CheckObjects Tic CheckInitialCheckbookInventory ' \
+ 'CreateCheckbookReception Tic ' \ + 'CreateCheckbookReception Tic ' \
+ 'CreateCheckAndCheckbookLineList Tic ' \ + 'CreateCheckAndCheckbookLineList Tic ' \
+ 'CheckWorklist Tic ' \
+ 'ConfirmCheckbookReception Tic ' \ + 'ConfirmCheckbookReception Tic ' \
+ 'CheckWorklist Tic ' \
+ 'DeliverCheckbookReception Tic ' \ + 'DeliverCheckbookReception Tic ' \
+ 'CheckItemsCreated ' \ + 'CheckItemsCreated ' \
+ 'CheckFinalCheckbookInventory' + 'CheckFinalCheckbookInventory'
...@@ -401,6 +455,16 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -401,6 +455,16 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'DeliverCheckbookReception4Fails ' + 'DeliverCheckbookReception4Fails '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
# Make sure that if we have an import, then everything
# will be confirmed automatically
sequence_string = 'Tic ' \
+ 'CreateCheckbookReception5 Tic ' \
+ 'CreateCheckAndCheckbookLineList5 Tic ' \
+ 'ConfirmCheckbookReception5 Tic ' \
+ 'DeliverCheckbookReception5 Tic ' \
+ 'CheckConfirmedCheckbookForImport Tic '
sequence_list.addSequenceString(sequence_string)
# play the sequence # play the sequence
sequence_list.play(self) sequence_list.play(self)
......
...@@ -373,6 +373,9 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas ...@@ -373,6 +373,9 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas
self.failUnless(message.find('Sorry, the item with reference')>=0) self.failUnless(message.find('Sorry, the item with reference')>=0)
self.failUnless(message.find('is not available any more')>=0) self.failUnless(message.find('is not available any more')>=0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.checkbook_usual_cash_transfer)
################################## ##################################
## Tests ## Tests
################################## ##################################
...@@ -389,11 +392,13 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas ...@@ -389,11 +392,13 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas
+ 'CreateCheckAndCheckbookLineList Tic ' \ + 'CreateCheckAndCheckbookLineList Tic ' \
+ 'CheckConfirmCheckbookUsualCashTransferRaiseError Tic ' \ + 'CheckConfirmCheckbookUsualCashTransferRaiseError Tic ' \
+ 'ChangeCheckbookUsualCashTransferStartDate Tic ' \ + 'ChangeCheckbookUsualCashTransferStartDate Tic ' \
+ 'CheckWorklist Tic ' \
+ 'ConfirmCheckbookUsualCashTransfer Tic ' \ + 'ConfirmCheckbookUsualCashTransfer Tic ' \
+ 'CheckConfirmedCheckbookInventory Tic ' \ + 'CheckConfirmedCheckbookInventory Tic ' \
+ 'ChangePreviousDeliveryDate Tic ' \ + 'ChangePreviousDeliveryDate Tic ' \
+ 'DeliverCheckbookUsualCashTransferFails Tic ' \ + 'DeliverCheckbookUsualCashTransferFails Tic ' \
+ 'PutBackPreviousDeliveryDate Tic ' \ + 'PutBackPreviousDeliveryDate Tic ' \
+ 'CheckWorklist Tic ' \
+ 'DeliverCheckbookUsualCashTransfer Tic ' \ + 'DeliverCheckbookUsualCashTransfer Tic ' \
+ 'CheckFinalCheckbookInventory' + 'CheckFinalCheckbookInventory'
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
......
...@@ -370,6 +370,9 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe ...@@ -370,6 +370,9 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe
self.failUnless(message.find('Sorry, the item with reference')>=0) self.failUnless(message.find('Sorry, the item with reference')>=0)
self.failUnless(message.find('is not available any more')>=0) self.failUnless(message.find('is not available any more')>=0)
def stepCheckWorklist(self, **kw):
self.checkWorklist(self.checkbook_vault_transfer)
################################## ##################################
## Tests ## Tests
################################## ##################################
...@@ -384,12 +387,15 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe ...@@ -384,12 +387,15 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe
sequence_string = 'Tic CheckObjects Tic CheckInitialCheckbookInventory ' \ sequence_string = 'Tic CheckObjects Tic CheckInitialCheckbookInventory ' \
+ 'CreateCheckbookVaultTransfer Tic ' \ + 'CreateCheckbookVaultTransfer Tic ' \
+ 'CreateCheckAndCheckbookLineList Tic ' \ + 'CreateCheckAndCheckbookLineList Tic ' \
+ 'CheckWorklist Tic ' \
+ 'OrderCheckbookVaultTransfer Tic ' \ + 'OrderCheckbookVaultTransfer Tic ' \
+ 'CheckWorklist Tic ' \
+ 'ConfirmCheckbookVaultTransfer Tic ' \ + 'ConfirmCheckbookVaultTransfer Tic ' \
+ 'CheckConfirmedCheckbookInventory Tic ' \ + 'CheckConfirmedCheckbookInventory Tic ' \
+ 'ChangePreviousDeliveryDate Tic ' \ + 'ChangePreviousDeliveryDate Tic ' \
+ 'DeliverCheckbookVaultTransferFails Tic ' \ + 'DeliverCheckbookVaultTransferFails Tic ' \
+ 'PutBackPreviousDeliveryDate Tic ' \ + 'PutBackPreviousDeliveryDate Tic ' \
+ 'CheckWorklist Tic ' \
+ 'DeliverCheckbookVaultTransfer Tic ' \ + 'DeliverCheckbookVaultTransfer Tic ' \
+ 'CheckFinalCheckbookInventory' + 'CheckFinalCheckbookInventory'
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
......
...@@ -309,16 +309,8 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin, ...@@ -309,16 +309,8 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin,
""" """
self.assertEqual(self.check_1.getSimulationState(),'confirmed') self.assertEqual(self.check_1.getSimulationState(),'confirmed')
def stepCheckConfirmedWorklist(self, sequence=None, sequence_list=None, **kw): def stepCheckStopPaymentWorklist(self, **kw):
""" self.checkWorklist(self.stop_payment)
"""
actions = self.getPortal().portal_actions.listFilteredActionsFor(self.stop_payment)
found = 0
for action in actions['global']:
if action.get('workflow_id', None) == 'stop_payment_workflow':
if action.get('title', None) == 'Stop Payment To Confirm (1)':
found = 1
self.assertEquals(found, 1)
################################## ##################################
## Tests ## Tests
...@@ -336,12 +328,13 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin, ...@@ -336,12 +328,13 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin,
+ 'CreateStopPayment Tic ' \ + 'CreateStopPayment Tic ' \
+ 'SetStopPaymentDebit Tic ' \ + 'SetStopPaymentDebit Tic ' \
+ 'ConfirmStopPayment Tic ' \ + 'ConfirmStopPayment Tic ' \
+ 'CheckConfirmedWorklist Tic ' \ + 'CheckStopPaymentWorklist Tic ' \
+ 'CheckLineCreated Tic ' \ + 'CheckLineCreated Tic ' \
+ 'CheckConfirmedCheckbookInventory ' \ + 'CheckConfirmedCheckbookInventory ' \
+ 'StartStopPayment Tic ' \ + 'StartStopPayment Tic ' \
+ 'CheckCheckIsStopped Tic ' \ + 'CheckCheckIsStopped Tic ' \
+ 'DebitStopStopPayment Tic ' \ + 'DebitStopStopPayment Tic ' \
+ 'CheckStopPaymentWorklist Tic ' \
+ 'DebitDeliverStopPayment Tic ' \ + 'DebitDeliverStopPayment Tic ' \
+ 'CheckCheckIsConfirmed Tic ' \ + 'CheckCheckIsConfirmed Tic ' \
+ 'CheckInitialAndFinalCheckbookInventory ' + 'CheckInitialAndFinalCheckbookInventory '
......
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