Commit f6568f52 authored by Łukasz Nowak's avatar Łukasz Nowak

- check that simulation movements are properly reindexed when delivery is cancelled


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28926 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7ca97703
...@@ -33,6 +33,7 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase ...@@ -33,6 +33,7 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from testOrder import TestOrderMixin from testOrder import TestOrderMixin
from DateTime import DateTime
class TestPackingListMixin(TestOrderMixin): class TestPackingListMixin(TestOrderMixin):
""" """
...@@ -1380,6 +1381,45 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) : ...@@ -1380,6 +1381,45 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
finally: finally:
delivery_builder.build = original_delivery_builder_build delivery_builder.build = original_delivery_builder_build
def test_16_simulation_reindexation_on_cancel(self):
self.organisation_portal_type = 'Organisation'
self.resource_portal_type = 'Product'
packing_list_module = self.portal.getDefaultModule(
portal_type=self.packing_list_portal_type)
organisation_module = self.portal.getDefaultModule(
portal_type=self.organisation_portal_type)
resource_module = self.portal.getDefaultModule(
portal_type=self.resource_portal_type)
source = organisation_module.newContent(
portal_type=self.organisation_portal_type)
destination = organisation_module.newContent(
portal_type=self.organisation_portal_type)
resource = resource_module.newContent(
portal_type=self.resource_portal_type)
packing_list = packing_list_module.newContent(
portal_type=self.packing_list_portal_type,
source_value=source,
destination_value=destination,
start_date=DateTime())
packing_list_line = packing_list.newContent(
portal_type=self.packing_list_line_portal_type,
resource_value=resource,
quantity=1)
packing_list.confirm()
transaction.commit()
self.tic()
self.assertEqual('confirmed', packing_list.getSimulationState())
simulation_movement = packing_list_line.getDeliveryRelatedValue(
portal_type='Simulation Movement')
self.assertEqual('confirmed', simulation_movement.getSimulationState())
packing_list.cancel()
transaction.commit()
self.tic()
self.assertEqual('cancelled', packing_list.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