Commit 85293006 authored by Jérome Perrin's avatar Jérome Perrin

test that there's no problem if we choose "do nothing" on split & defer action.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31041 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f715919c
...@@ -279,6 +279,22 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -279,6 +279,22 @@ class TestPackingListMixin(TestOrderMixin):
stop_date=self.datetime + 25, stop_date=self.datetime + 25,
**kw) **kw)
def stepSplitAndDeferDoNothingPackingList(self, sequence=None, sequence_list=None, **kw):
"""
Do the split and defer action, but choose "do nothing" for divergences
"""
packing_list = sequence.get('packing_list')
kw = {'listbox':[
{'listbox_key':line.getRelativeUrl(),
'choice':'ignore'} for line in packing_list.getMovementList() \
if line.isDivergent()]}
self.portal.portal_workflow.doActionFor(
packing_list,
'split_and_defer_action',
start_date=self.datetime + 15,
stop_date=self.datetime + 25,
**kw)
def stepCheckPackingListSplitted(self, sequence=None, sequence_list=None, **kw): def stepCheckPackingListSplitted(self, sequence=None, sequence_list=None, **kw):
""" """
Test if packing list was splitted Test if packing list was splitted
...@@ -1293,6 +1309,31 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) : ...@@ -1293,6 +1309,31 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
def test_SplitAndDeferDoNothing(self, quiet=quiet, run=run_all_test):
"""
Use split & defer to solve a divergence, but choose do nothing for all
lines.
"""
if not run: return
sequence_list = SequenceList()
# Test with a simply order without cell
sequence_string = self.default_sequence + '\
stepIncreasePackingListLineQuantity \
stepCheckPackingListIsCalculating \
stepTic \
stepCheckPackingListIsDiverged \
stepSplitAndDeferDoNothingPackingList \
stepTic \
stepCheckPackingListIsDiverged \
stepCheckPackingListIsDivergent \
stepCheckPackingListNotSolved \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet)
def test_12_PackingListLineChangeResource(self, quiet=quiet, run=run_all_test): def test_12_PackingListLineChangeResource(self, quiet=quiet, run=run_all_test):
""" """
Test if delivery diverged when we change the resource. Test if delivery diverged when we change the resource.
...@@ -1426,6 +1467,7 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) : ...@@ -1426,6 +1467,7 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
self.assertEqual('cancelled', packing_list.getSimulationState()) self.assertEqual('cancelled', packing_list.getSimulationState())
self.assertEqual('cancelled', simulation_movement.getSimulationState()) self.assertEqual('cancelled', simulation_movement.getSimulationState())
class TestPurchasePackingListMixin(TestPackingListMixin): class TestPurchasePackingListMixin(TestPackingListMixin):
"""Mixing class with steps to test purchase packing lists. """Mixing class with steps to test purchase packing lists.
""" """
......
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