Commit f4129c1f authored by Sebastien Robin's avatar Sebastien Robin

two tests were really too similar, this is like duplication of

code. Drop one of them and keep the other

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44463 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent caa46a58
......@@ -815,114 +815,6 @@ class TestBPMisFrozenImplementation(TestBPMDummyDeliveryMovementMixin):
self.assertEqual(self.split_simulation_movement.isFrozen(), True)
self.assertEqual(self.split_invoicing_simulation_movement.isFrozen(), False)
@newSimulationExpectedFailure
def test_isFrozen_OrderedInvoicedDelivered(self):
"""Test isFrozen for ordered, invoiced and invoiced sequence"""
self._createOrderedInvoicedDeliveredBusinessProcess()
order = self._createDelivery()
order_line = self._createMovement(order)
applied_rule = self.portal.portal_simulation.newContent(
portal_type='Applied Rule', causality_value=order)
simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement',
delivery_value = order_line,
causality_value = self.delivery_path
)
delivery_rule = simulation_movement.newContent(
portal_type='Applied Rule')
delivery_simulation_movement = delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
invoicing_rule = delivery_simulation_movement.newContent(
portal_type='Applied Rule')
invoicing_simulation_movement = invoicing_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.invoice_path)
self.stepTic()
self.assertEqual(self.delivery_path.isFrozen(order), False)
self.assertEqual(self.invoice_path.isFrozen(order), False)
self.assertEqual(simulation_movement.isFrozen(), False)
self.assertEqual(invoicing_simulation_movement.isFrozen(), False)
delivery = self._createDelivery(causality_value = order)
delivery_line = self._createMovement(delivery)
invoicing_simulation_movement.edit(delivery_value = delivery_line)
self.stepTic()
self.assertEqual(self.delivery_path.isFrozen(order), False)
self.assertEqual(self.invoice_path.isFrozen(order), False)
self.assertEqual(self.delivery_path.isFrozen(delivery), False)
self.assertEqual(self.invoice_path.isFrozen(delivery), False)
self.assertEqual(simulation_movement.isFrozen(), False)
self.assertEqual(invoicing_simulation_movement.isFrozen(), False)
# put delivery in simulation state configured on path (and this state is
# available directly on movements)
delivery.setSimulationState(self.frozen_state)
self.assertEqual(self.frozen_state, delivery.getSimulationState())
self.stepTic()
self.assertEqual(self.delivery_path.isFrozen(order), False)
self.assertEqual(self.invoice_path.isFrozen(order), True)
self.assertEqual(self.delivery_path.isFrozen(delivery), False)
self.assertEqual(self.invoice_path.isFrozen(delivery), True)
self.assertEqual(simulation_movement.isFrozen(), False)
self.assertEqual(invoicing_simulation_movement.isFrozen(), True)
# now simulate compensation
compensated_simulation_movement = delivery_rule.newContent(
portal_type = 'Simulation Movement',
delivery_value = order_line,
causality_value = self.delivery_path
)
compensated_invoicing_rule = compensated_simulation_movement.newContent(
portal_type='Applied Rule')
compensated_invoicing_simulation_movement = compensated_invoicing_rule \
.newContent(portal_type='Simulation Movement',
causality_value = self.invoice_path)
# and delivery some part of tree
another_delivery = self._createDelivery(causality_value = delivery)
another_delivery_line = self._createMovement(another_delivery)
delivery_simulation_movement.edit(delivery_value=another_delivery_line)
self.stepTic()
self.assertEqual(self.delivery_path.isFrozen(order), False)
self.assertEqual(self.invoice_path.isFrozen(order), False)
self.assertEqual(self.delivery_path.isFrozen(delivery), False)
self.assertEqual(self.invoice_path.isFrozen(delivery), True)
self.assertEqual(simulation_movement.isFrozen(), False)
self.assertEqual(invoicing_simulation_movement.isFrozen(), True)
self.assertEqual(compensated_simulation_movement.isFrozen(), False)
self.assertEqual(compensated_invoicing_simulation_movement.isFrozen(),
False)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestBPMImplementation))
......
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