Commit 2fed99b2 authored by Aurel's avatar Aurel

modify test to take inventory workflow into account


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7495 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6655670a
......@@ -255,14 +255,6 @@ class TestERP5BankingInventory(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.cash_inventory.getTotalPrice(), 10000 * 5.0)
def stepCheckInventoryForLine1(self, sequence=None, sequence_list=None, **kwd):
"""
Check that compution of inventory at vault caisse_2 is right after confirm and before deliver
"""
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.paris.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.paris.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
def stepCreateInventoryLine2(self, sequence=None, sequence_list=None, **kwd):
"""
Create the cash inventory line 2 wiht coins of 200 and check it has been well created
......@@ -320,14 +312,6 @@ class TestERP5BankingInventory(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.cash_inventory.getTotalPrice(), 10000 * 5.0 + 200 * 12.0)
def stepCheckInventoryForLine2(self, sequence=None, sequence_list=None, **kwd):
"""
Check that compution of inventory at vault caisse_2 is right after confirm and before deliver
"""
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.paris.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.paris.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
def stepCreateInventoryLine3(self, sequence=None, sequence_list=None, **kwd):
"""
Create an invalid cash inventory line and
......@@ -374,6 +358,7 @@ class TestERP5BankingInventory(TestERP5BankingMixin, ERP5TypeTestCase):
else:
self.fail('Wrong cell created : %s' % cell.getId())
def stepCheckTotal(self, sequence=None, sequence_list=None, **kwd):
"""
Check the total after the creation of the two cash inventory lines
......@@ -386,6 +371,26 @@ class TestERP5BankingInventory(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.cash_inventory.getTotalPrice(), 10000 * 5.0 + 200 * 12.0 + 5000 * 24)
def stepDeliverInventory(self, sequence=None, sequence_list=None, **kw):
"""
Deliver the inventory
"""
state = self.cash_inventory_group.cash_inventory.getSimulationState()
# check that state is draft
self.assertEqual(state, 'draft')
self.workflow_tool.doActionFor(self.cash_inventory_group.cash_inventory, 'deliver_action', wf_id='inventory_workflow')
# execute tic
self.stepTic()
# get state of cash sorting
state = self.cash_inventory_group.cash_inventory.getSimulationState()
# check that state is delivered
self.assertEqual(state, 'delivered')
# get workflow history
workflow_history = self.workflow_tool.getInfoFor(ob=self.cash_inventory_group.cash_inventory, name='history', wf_id='inventory_workflow')
# check len of len workflow history is 6
self.assertEqual(len(workflow_history), 3)
def stepCheckInventory(self, sequence=None, sequence_list=None, **kwd):
"""
Check that compution of inventory at vault caisse_2 is right after confirm and before deliver
......@@ -412,10 +417,10 @@ class TestERP5BankingInventory(TestERP5BankingMixin, ERP5TypeTestCase):
# define the sequence
sequence_string = 'Tic CheckObjects Tic CheckInitialInventory ' \
+ 'CreateCashInventoryGroup CreateCashInventory ' \
+ 'CreateInventoryLine1 CheckSubTotal1 CheckInventoryForLine1 ' \
+ 'CreateInventoryLine2 CheckSubTotal2 CheckInventoryForLine2 ' \
+ 'CreateInventoryLine1 CheckSubTotal1 ' \
+ 'CreateInventoryLine2 CheckSubTotal2 ' \
+ 'CreateInventoryLine3 CheckTotal ' \
+ 'CheckInventory'
+ 'DeliverInventory Tic CheckInventory'
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