Commit 7044884b authored by Vincent Pelletier's avatar Vincent Pelletier

Move hq_usual_vault_incomming stock checks out of checkFinalInventory since...

Move hq_usual_vault_incomming stock checks out of checkFinalInventory since it's not constant anymore.
Add checks for incomming banknotes stocks.
Clear HQ module at test end, after all sotck checks are done.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18939 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c4271961
...@@ -331,6 +331,8 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -331,6 +331,8 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
Check the final inventory when document got rejected without HQ request Check the final inventory when document got rejected without HQ request
""" """
self.checkBanknoteInventory(node_path=self.usual_vault.getRelativeUrl(), quantity=5.0) self.checkBanknoteInventory(node_path=self.usual_vault.getRelativeUrl(), quantity=5.0)
self.checkBanknoteInventory(node_path=self.usual_vault_incomming.getRelativeUrl(), quantity=0.0)
self.checkBanknoteInventory(node_path=self.hq_usual_vault_incomming.getRelativeUrl(), quantity=0.0)
self.checkFinalInventory() self.checkFinalInventory()
stepCheckFinalInventoryWithNoPayBackAfterHQRequest = stepCheckFinalInventoryWithNoPayBack stepCheckFinalInventoryWithNoPayBackAfterHQRequest = stepCheckFinalInventoryWithNoPayBack
...@@ -426,6 +428,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -426,6 +428,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
def stepCheckFinalInventoryWithPayBack(self, sequence=None, sequence_list=None, **kwd): def stepCheckFinalInventoryWithPayBack(self, sequence=None, sequence_list=None, **kwd):
self.checkBanknoteInventory(node_path=self.usual_vault.getRelativeUrl(), quantity=0.0, get_inventory_kw={'variation_text': '%cash_status/valid%'}) self.checkBanknoteInventory(node_path=self.usual_vault.getRelativeUrl(), quantity=0.0, get_inventory_kw={'variation_text': '%cash_status/valid%'})
self.checkBanknoteInventory(node_path=self.usual_vault_incomming.getRelativeUrl(), quantity=5.0) self.checkBanknoteInventory(node_path=self.usual_vault_incomming.getRelativeUrl(), quantity=5.0)
self.checkBanknoteInventory(node_path=self.hq_usual_vault_incomming.getRelativeUrl(), quantity=0.0)
self.checkFinalInventory() self.checkFinalInventory()
def checkFinalInventory(self): def checkFinalInventory(self):
...@@ -434,7 +437,6 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -434,7 +437,6 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
self.checkBanknoteInventory(node_path=self.maculated_banknote_vault.getRelativeUrl(), quantity=0.0) self.checkBanknoteInventory(node_path=self.maculated_banknote_vault.getRelativeUrl(), quantity=0.0)
self.checkBanknoteInventory(node_path=self.hq_mutilated_banknote_vault.getRelativeUrl(), quantity=0.0) self.checkBanknoteInventory(node_path=self.hq_mutilated_banknote_vault.getRelativeUrl(), quantity=0.0)
self.checkBanknoteInventory(node_path=self.hq_maculated_banknote_vault.getRelativeUrl(), quantity=0.0) self.checkBanknoteInventory(node_path=self.hq_maculated_banknote_vault.getRelativeUrl(), quantity=0.0)
self.checkBanknoteInventory(node_path=self.hq_usual_vault_incomming.getRelativeUrl(), quantity=0.0)
stepCheckFinalInventoryWithPayBackAfterHQRequest = stepCheckFinalInventoryWithPayBack stepCheckFinalInventoryWithPayBackAfterHQRequest = stepCheckFinalInventoryWithPayBack
...@@ -614,6 +616,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -614,6 +616,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
""" """
self.checkBanknoteInventory(node_path=self.usual_vault.getRelativeUrl(), quantity=5.0) self.checkBanknoteInventory(node_path=self.usual_vault.getRelativeUrl(), quantity=5.0)
self.checkBanknoteInventory(node_path=self.hq_mutilated_banknote_vault.getRelativeUrl(), quantity=0.0) self.checkBanknoteInventory(node_path=self.hq_mutilated_banknote_vault.getRelativeUrl(), quantity=0.0)
self.checkBanknoteInventory(node_path=self.hq_usual_vault_incomming.getRelativeUrl(), quantity=0.0)
self.checkFinalInventory() self.checkFinalInventory()
def stepClearHQMutilatedBanknoteModule(self, sequence=None, sequence_list=None, **kw): def stepClearHQMutilatedBanknoteModule(self, sequence=None, sequence_list=None, **kw):
...@@ -659,8 +662,35 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -659,8 +662,35 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
self.checkBanknoteInventory(node_path=self.hq_usual_vault.getRelativeUrl(), quantity=5.0) self.checkBanknoteInventory(node_path=self.hq_usual_vault.getRelativeUrl(), quantity=5.0)
self.checkBanknoteInventory(node_path=self.hq_mutilated_banknote_vault.getRelativeUrl(), quantity=0.0) self.checkBanknoteInventory(node_path=self.hq_mutilated_banknote_vault.getRelativeUrl(), quantity=0.0)
self.checkBanknoteInventory(node_path=self.usual_vault_incomming.getRelativeUrl(), quantity=0.0) self.checkBanknoteInventory(node_path=self.usual_vault_incomming.getRelativeUrl(), quantity=0.0)
self.checkBanknoteInventory(node_path=self.hq_usual_vault_incomming.getRelativeUrl(), quantity=5.0)
self.checkFinalInventory() self.checkFinalInventory()
def CheckInventoryWithIncommingBanknotes(self, node, hq_node):
"""
Check that mutilated banknotes transmites by agency are in the right stock place.
"""
self.checkBanknoteInventory(node_path=node.getRelativeUrl(), quantity=5.0)
self.checkBanknoteInventory(node_path=hq_node.getRelativeUrl(), quantity=0.0)
def stepCheckInventoryWithIncommingMutilatedBanknotes(self, sequence=None, sequence_list=None, **kwd):
self.CheckInventoryWithIncommingBanknotes(self.mutilated_banknote_vault, self.hq_mutilated_banknote_vault)
def stepCheckInventoryWithIncommingMaculatedBanknotes(self, sequence=None, sequence_list=None, **kwd):
self.CheckInventoryWithIncommingBanknotes(self.maculated_banknote_vault, self.hq_maculated_banknote_vault)
def CheckHQInventoryWithIncommingBanknotes(self, node, hq_node):
"""
Check that mutilated banknotes transmites by agency are in the right stock place.
"""
self.checkBanknoteInventory(node_path=node.getRelativeUrl(), quantity=0.0)
self.checkBanknoteInventory(node_path=hq_node.getRelativeUrl(), quantity=5.0)
def stepCheckHQInventoryWithIncommingMutilatedBanknotes(self, sequence=None, sequence_list=None, **kwd):
self.CheckHQInventoryWithIncommingBanknotes(self.mutilated_banknote_vault, self.hq_mutilated_banknote_vault)
def stepCheckHQInventoryWithIncommingMaculatedBanknotes(self, sequence=None, sequence_list=None, **kwd):
self.CheckHQInventoryWithIncommingBanknotes(self.maculated_banknote_vault, self.hq_maculated_banknote_vault)
def stepSetMaculatedState(self, sequence=None, sequence_list=None, **kwd): def stepSetMaculatedState(self, sequence=None, sequence_list=None, **kwd):
""" """
Inform that the banknotes are in a maculated state, not in a mutilated state. Inform that the banknotes are in a maculated state, not in a mutilated state.
...@@ -688,6 +718,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -688,6 +718,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'CreateMutilatedBanknote Tic TryStopWithNoLineDefined ' \ + 'CreateMutilatedBanknote Tic TryStopWithNoLineDefined ' \
+ 'CreateIncomingLine Tic TryStopWithNoAmountDefined ' \ + 'CreateIncomingLine Tic TryStopWithNoAmountDefined ' \
+ 'StopDocument Tic ' \ + 'StopDocument Tic ' \
+ 'CheckInventoryWithIncommingMutilatedBanknotes ' \
+ 'CheckMutilatedBanknoteInventory ' \ + 'CheckMutilatedBanknoteInventory ' \
+ 'CancelDocument Tic ' \ + 'CancelDocument Tic ' \
+ 'CheckFinalInventoryWithNoPayBack ClearMutilatedBanknoteModule' + 'CheckFinalInventoryWithNoPayBack ClearMutilatedBanknoteModule'
...@@ -697,6 +728,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -697,6 +728,7 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'CreateMutilatedBanknote SetMaculatedState Tic ' \ + 'CreateMutilatedBanknote SetMaculatedState Tic ' \
+ 'CreateIncomingLine Tic ' \ + 'CreateIncomingLine Tic ' \
+ 'StopDocument Tic ' \ + 'StopDocument Tic ' \
+ 'CheckInventoryWithIncommingMaculatedBanknotes ' \
+ 'CheckMaculatedBanknoteInventory ' \ + 'CheckMaculatedBanknoteInventory ' \
+ 'TryFinishWithNoLineDefined CreateExchangedLine Tic TryFinishWithNoAmountDefined FinishDocument Tic ' \ + 'TryFinishWithNoLineDefined CreateExchangedLine Tic TryFinishWithNoAmountDefined FinishDocument Tic ' \
+ 'TryDeliverWithNoLineDefined CreateOutgoingLine Tic TryDeliverWithWrongAmountDefined DeliverDocument Tic ' \ + 'TryDeliverWithNoLineDefined CreateOutgoingLine Tic TryDeliverWithWrongAmountDefined DeliverDocument Tic ' \
...@@ -707,18 +739,20 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -707,18 +739,20 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'CreateMutilatedBanknote Tic ' \ + 'CreateMutilatedBanknote Tic ' \
+ 'CreateIncomingLine Tic ' \ + 'CreateIncomingLine Tic ' \
+ 'StopDocument Tic ' \ + 'StopDocument Tic ' \
+ 'CheckInventoryWithIncommingMutilatedBanknotes ' \
+ 'CreateExchangedLine Tic TryPlanWithExchangedLine DelExchangedLine Tic PlanDocument Tic ' \ + 'CreateExchangedLine Tic TryPlanWithExchangedLine DelExchangedLine Tic PlanDocument Tic ' \
+ 'HQLogin ' \ + 'HQLogin ' \
+ 'CheckHQInitialInventory ' \ + 'CheckHQInitialInventory ' \
+ 'CreateHQMutilatedBanknote Tic '\ + 'CreateHQMutilatedBanknote Tic '\
+ 'TryStopHQWithNoLineDefined Tic CreateHQIncomingLine Tic TryStopHQWithNoAmountDefined StopHQDocument Tic ' \ + 'TryStopHQWithNoLineDefined Tic CreateHQIncomingLine Tic TryStopHQWithNoAmountDefined StopHQDocument Tic ' \
+ 'CheckHQInventoryWithIncommingMutilatedBanknotes ' \
+ 'CheckHQMutilatedBanknoteInventory ' \ + 'CheckHQMutilatedBanknoteInventory ' \
+ 'TryPlanHQDocument ' \ + 'TryPlanHQDocument ' \
+ 'CancelHQDocument Tic ' \ + 'CancelHQDocument Tic ' \
+ 'HQLogout ' \ + 'HQLogout ' \
+ 'CheckHQFinalInventoryWithNoPayBack ClearHQMutilatedBanknoteModule Tic ' \ + 'CheckHQFinalInventoryWithNoPayBack ' \
+ 'CancelDocument Tic ' \ + 'CancelDocument Tic ' \
+ 'CheckFinalInventoryWithNoPayBackAfterHQRequest ClearMutilatedBanknoteModule' + 'CheckFinalInventoryWithNoPayBackAfterHQRequest ClearMutilatedBanknoteModule ClearHQMutilatedBanknoteModule'
# sequence 4 : ask headquarters then payback, maculated banknotes # sequence 4 : ask headquarters then payback, maculated banknotes
sequence_string_4 = 'Tic CheckObjects Tic CheckInitialInventory ' \ sequence_string_4 = 'Tic CheckObjects Tic CheckInitialInventory ' \
...@@ -730,13 +764,14 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -730,13 +764,14 @@ class TestERP5BankingMutilatedBanknote(TestERP5BankingMixin, ERP5TypeTestCase):
+ 'CheckHQInitialInventory ' \ + 'CheckHQInitialInventory ' \
+ 'CreateHQMutilatedBanknote SetHQMaculatedState Tic ' \ + 'CreateHQMutilatedBanknote SetHQMaculatedState Tic ' \
+ 'CreateHQIncomingLine Tic StopHQDocument Tic ' \ + 'CreateHQIncomingLine Tic StopHQDocument Tic ' \
+ 'CheckHQInventoryWithIncommingMaculatedBanknotes ' \
+ 'CheckHQMaculatedBanknoteInventory ' \ + 'CheckHQMaculatedBanknoteInventory ' \
+ 'TryFinishHQWithNoLineDefined CreateHQExchangedLine Tic TryFinishHQWithNoAmountDefined FinishHQDocument Tic ' \ + 'TryFinishHQWithNoLineDefined CreateHQExchangedLine Tic TryFinishHQWithNoAmountDefined FinishHQDocument Tic ' \
+ 'HQLogout ' \ + 'HQLogout ' \
+ 'CheckHQFinalInventoryWithPayBack ClearHQMutilatedBanknoteModule Tic '\ + 'CheckHQFinalInventoryWithPayBack '\
+ 'CreateExchangedLine Tic FinishDocument Tic ' \ + 'CreateExchangedLine Tic FinishDocument Tic ' \
+ 'CreateOutgoingLine Tic DeliverDocument Tic ' \ + 'CreateOutgoingLine Tic DeliverDocument Tic ' \
+ 'CheckFinalInventoryWithPayBackAfterHQRequest ClearMutilatedBanknoteModule' + 'CheckFinalInventoryWithPayBackAfterHQRequest ClearMutilatedBanknoteModule ClearHQMutilatedBanknoteModule'
sequence_list.addSequenceString(sequence_string_1) sequence_list.addSequenceString(sequence_string_1)
sequence_list.addSequenceString(sequence_string_2) sequence_list.addSequenceString(sequence_string_2)
......
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