Commit 336e1999 authored by Sebastien Robin's avatar Sebastien Robin

test distinct cash status and emission letter

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12955 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7fb02632
...@@ -124,6 +124,7 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -124,6 +124,7 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase):
self.encaisse_externe = self.paris.caveau.auxiliaire.encaisse_des_externes self.encaisse_externe = self.paris.caveau.auxiliaire.encaisse_des_externes
#self.encaisse_auxiliaire = self.paris.caveau.auxiliaire.encaisse_des_billets_recus_pour_ventilation.madrid #self.encaisse_auxiliaire = self.paris.caveau.auxiliaire.encaisse_des_billets_recus_pour_ventilation.madrid
self.encaisse_auxiliaire = self.paris.caveau.auxiliaire.encaisse_des_billets_et_monnaies self.encaisse_auxiliaire = self.paris.caveau.auxiliaire.encaisse_des_billets_et_monnaies
self.encaisse_ventilation = self.paris.caveau.auxiliaire.encaisse_des_billets_recus_pour_ventilation.madrid
self.createCashInventory(source=None, destination=self.encaisse_tri, currency=self.currency_1, self.createCashInventory(source=None, destination=self.encaisse_tri, currency=self.currency_1,
line_list=line_list) line_list=line_list)
...@@ -142,6 +143,8 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -142,6 +143,8 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase):
self.createERP5Users(user_dict) self.createERP5Users(user_dict)
self.logout() self.logout()
self.login('super_user') self.login('super_user')
# open counter date and counter
self.openCounterDate(site=self.paris)
...@@ -391,7 +394,7 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -391,7 +394,7 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase):
""" """
# create the line # create the line
self.addCashLineToDelivery(self.cash_sorting, 'valid_outgoing_line_1', 'Outgoing Cash Sorting Line', self.billet_10000, self.addCashLineToDelivery(self.cash_sorting, 'valid_outgoing_line_1', 'Outgoing Cash Sorting Line', self.billet_10000,
('emission_letter', 'cash_status', 'variation'), ('emission_letter/p', 'cash_status/valid') + self.variation_list, ('emission_letter', 'cash_status', 'variation'), ('emission_letter/not_defined', 'cash_status/to_sort') + self.variation_list,
self.quantity_10000) self.quantity_10000)
# execute tic # execute tic
self.stepTic() self.stepTic()
...@@ -411,7 +414,7 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -411,7 +414,7 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(len(self.valid_outgoing_line.objectValues()), 2) self.assertEqual(len(self.valid_outgoing_line.objectValues()), 2)
for variation in self.variation_list: for variation in self.variation_list:
# get the delivery cell # get the delivery cell
cell = self.valid_outgoing_line.getCell('emission_letter/p', variation, 'cash_status/valid') cell = self.valid_outgoing_line.getCell('emission_letter/not_defined', variation, 'cash_status/to_sort')
# check the portal type # check the portal type
self.assertEqual(cell.getPortalType(), 'Outgoing Cash Sorting Cell') self.assertEqual(cell.getPortalType(), 'Outgoing Cash Sorting Cell')
if cell.getId() == 'movement_0_0_0': if cell.getId() == 'movement_0_0_0':
...@@ -574,9 +577,9 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -574,9 +577,9 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase):
Check that compution of inventory at vault encaisse_externe is right after confirm and before deliver Check that compution of inventory at vault encaisse_externe is right after confirm and before deliver
""" """
# check we have 0 banknote of 10000 currently # check we have 0 banknote of 10000 currently
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_reserve.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_ventilation.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
# check we will have 5 banknotes of 10000 after deliver # check we will have 5 banknotes of 10000 after deliver
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.encaisse_reserve.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) self.assertEqual(self.simulation_tool.getFutureInventory(node=self.encaisse_ventilation.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
# check we have 0 coin of 200 currently # check we have 0 coin of 200 currently
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_externe.getRelativeUrl(), resource = self.billet_200.getRelativeUrl()), 0.0) self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_externe.getRelativeUrl(), resource = self.billet_200.getRelativeUrl()), 0.0)
# check we will have 12 coins of 200 after deliver # check we will have 12 coins of 200 after deliver
...@@ -627,8 +630,8 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -627,8 +630,8 @@ class TestERP5BankingCashClassification(TestERP5BankingMixin, ERP5TypeTestCase):
Check inventory at destination (vault encaisse_externe) after deliver of the cash sorting Check inventory at destination (vault encaisse_externe) after deliver of the cash sorting
""" """
# check we have 5 banknotes of 10000 # check we have 5 banknotes of 10000
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_reserve.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_ventilation.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.encaisse_reserve.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0) self.assertEqual(self.simulation_tool.getFutureInventory(node=self.encaisse_ventilation.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
# check we have 12 coins of 200 # check we have 12 coins of 200
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_externe.getRelativeUrl(), resource = self.billet_200.getRelativeUrl()), 12.0) self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.encaisse_externe.getRelativeUrl(), resource = self.billet_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.encaisse_externe.getRelativeUrl(), resource = self.billet_200.getRelativeUrl()), 12.0) self.assertEqual(self.simulation_tool.getFutureInventory(node=self.encaisse_externe.getRelativeUrl(), resource = self.billet_200.getRelativeUrl()), 12.0)
......
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