Commit 01d36305 authored by Sebastien Robin's avatar Sebastien Robin

added one more test, check that when we increase the quantity on a line, then...

added one more test, check that when we increase the quantity on a line, then no new packing list is created


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4677 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a6aab841
...@@ -175,7 +175,7 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -175,7 +175,7 @@ class TestPackingListMixin(TestOrderMixin):
packing_list = sequence.get('packing_list') packing_list = sequence.get('packing_list')
self.assertEquals(False,packing_list.isDivergent()) self.assertEquals(False,packing_list.isDivergent())
def stepChangePackingListLineQuantity(self, sequence=None, sequence_list=None, **kw): def stepDecreasePackingListLineQuantity(self, sequence=None, sequence_list=None, **kw):
""" """
Test if packing list is divergent Test if packing list is divergent
""" """
...@@ -184,6 +184,15 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -184,6 +184,15 @@ class TestPackingListMixin(TestOrderMixin):
portal_type=self.packing_list_line_portal_type): portal_type=self.packing_list_line_portal_type):
packing_list_line.edit(quantity=self.default_quantity-1) packing_list_line.edit(quantity=self.default_quantity-1)
def stepIncreasePackingListLineQuantity(self, sequence=None, sequence_list=None, **kw):
"""
Test if packing list is divergent
"""
packing_list = sequence.get('packing_list')
for packing_list_line in packing_list.objectValues(
portal_type=self.packing_list_line_portal_type):
packing_list_line.edit(quantity=self.default_quantity+1)
def stepSplitAndDeferPackingList(self, sequence=None, sequence_list=None, **kw): def stepSplitAndDeferPackingList(self, sequence=None, sequence_list=None, **kw):
""" """
Do the split and defer action Do the split and defer action
...@@ -216,6 +225,24 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -216,6 +225,24 @@ class TestPackingListMixin(TestOrderMixin):
portal_type= self.packing_list_line_portal_type): portal_type= self.packing_list_line_portal_type):
self.assertEquals(1,line.getQuantity()) self.assertEquals(1,line.getQuantity())
def stepCheckPackingListNotSplitted(self, sequence=None, sequence_list=None, **kw):
"""
Test if packing list is divergent
"""
order = sequence.get('order')
packing_list_list = order.getCausalityRelatedValueList(
portal_type=self.packing_list_portal_type)
self.assertEquals(1,len(packing_list_list))
packing_list1 = sequence.get('packing_list')
for line in packing_list1.objectValues(
portal_type= self.packing_list_line_portal_type):
self.assertEquals(self.default_quantity+1,line.getQuantity())
simulation_list = line.getDeliveryRelatedValueList(
portal_type='Simulation Movement')
self.assertEquals(len(simulation_list),1)
simulation_movement = simulation_list[0]
self.assertEquals(simulation_movement.getQuantity(),self.default_quantity+1)
def stepChangePackingListDestination(self, sequence=None, sequence_list=None, **kw): def stepChangePackingListDestination(self, sequence=None, sequence_list=None, **kw):
""" """
Test if packing list is divergent Test if packing list is divergent
...@@ -419,19 +446,20 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -419,19 +446,20 @@ class TestPackingListMixin(TestOrderMixin):
class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) : class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
run_all_test = 1 run_all_test = 1
def test_01_PackingListChangeQuantity(self, quiet=0, run=run_all_test): def test_01_PackingListDecreaseQuantity(self, quiet=0, run=run_all_test):
""" """
Change the quantity on an delivery line, then Change the quantity on an delivery line, then
see if the packing list is divergent and then see if the packing list is divergent and then
see split and defer the packing list
""" """
if not run: return if not run: return
sequence_list = SequenceList() sequence_list = SequenceList()
# Test with a simply order without cell # Test with a simply order without cell
sequence_string = self.default_sequence + '\ sequence_string = self.default_sequence + '\
ChangePackingListLineQuantity \ DecreasePackingListLineQuantity \
CheckPackingListIsCalculating \ CheckPackingListIsCalculating \
SplitAndDeferPackingList \ SplitAndDeferPackingList \
Tic \ Tic \
...@@ -612,6 +640,27 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) : ...@@ -612,6 +640,27 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
sequence_list.play(self) sequence_list.play(self)
def test_10_PackingListIncreaseQuantity(self, quiet=0, run=run_all_test):
"""
Change the quantity on an delivery line, then
see if the packing list is divergent and then
split and defer the packing list
"""
if not run: return
sequence_list = SequenceList()
# Test with a simply order without cell
sequence_string = self.default_sequence + '\
IncreasePackingListLineQuantity \
CheckPackingListIsCalculating \
SplitAndDeferPackingList \
Tic \
CheckPackingListIsSolved \
CheckPackingListNotSplitted \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
if __name__ == '__main__': if __name__ == '__main__':
framework() framework()
......
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