Commit c8c7099b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

add tests that checks new behaviour (i.e. no longer using 'order' category in...

add tests that checks new behaviour (i.e. no longer using 'order' category in top level simulation movements.)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32534 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b3ee2ba4
...@@ -585,7 +585,7 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -585,7 +585,7 @@ class TestProductionOrderMixin(TestOrderMixin):
want_consume_quantity = self.colour_size_quantity_dict[colour][size] want_consume_quantity = self.colour_size_quantity_dict[colour][size]
want_consume_for_production = want_produced_quantity * want_consume_quantity want_consume_for_production = want_produced_quantity * want_consume_quantity
produced_movement = order_movement.getOrderRelatedValue(\ produced_movement = order_movement.getDeliveryRelatedValue(\
portal_type='Simulation Movement') portal_type='Simulation Movement')
self.assertEquals( self.assertEquals(
...@@ -715,7 +715,7 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -715,7 +715,7 @@ class TestProductionOrderMixin(TestOrderMixin):
LOG('Raise Assertion error',0,'') LOG('Raise Assertion error',0,'')
LOG('object.getQuantity()',0,object.getQuantity()) LOG('object.getQuantity()',0,object.getQuantity())
LOG('object.__dict__',0,object.__dict__) LOG('object.__dict__',0,object.__dict__)
LOG('object.getOrderValue().getQuantity()',0,object.getOrderValue().getQuantity()) LOG('object.getDeliveryValue().getQuantity()',0,object.getDeliveryValue().getQuantity())
raise AssertionError, "Attribute: %s, Value: %s, Result: %s" %\ raise AssertionError, "Attribute: %s, Value: %s, Result: %s" %\
(attribute, value, getattr(object, attribute)()) (attribute, value, getattr(object, attribute)())
...@@ -730,7 +730,7 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -730,7 +730,7 @@ class TestProductionOrderMixin(TestOrderMixin):
simulation_movement_list = sequence.get('simulation_movement_list') simulation_movement_list = sequence.get('simulation_movement_list')
self.assertEquals(1, len(simulation_movement_list)) self.assertEquals(1, len(simulation_movement_list))
order_line = sequence.get('order_line') order_line = sequence.get('order_line')
related_simulation_movement_list = order_line.getOrderRelatedValueList() related_simulation_movement_list = order_line.getDeliveryRelatedValueList()
self.assertEquals(1, len(related_simulation_movement_list)) self.assertEquals(1, len(related_simulation_movement_list))
related_simulation_movement = related_simulation_movement_list[0] related_simulation_movement = related_simulation_movement_list[0]
self.assertEquals(related_simulation_movement, self.assertEquals(related_simulation_movement,
...@@ -754,6 +754,17 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -754,6 +754,17 @@ class TestProductionOrderMixin(TestOrderMixin):
applied_rule = applied_rule_list[0] applied_rule = applied_rule_list[0]
self.assertEquals("Applied Rule", applied_rule.getPortalType()) self.assertEquals("Applied Rule", applied_rule.getPortalType())
portal_rules = getToolByName(applied_rule, 'portal_rules') portal_rules = getToolByName(applied_rule, 'portal_rules')
self.assertEquals('default_delivering_rule', \
applied_rule.getSpecialiseReference())
# Test next applied rule
simulation_movement_list = applied_rule.objectValues()
self.assertEquals(1, len(simulation_movement_list))
simulation_movement = simulation_movement_list[0]
applied_rule_list = simulation_movement.objectValues()
self.assertEquals(1, len(applied_rule_list))
applied_rule = applied_rule_list[0]
self.assertEquals("Applied Rule", applied_rule.getPortalType())
portal_rules = getToolByName(applied_rule, 'portal_rules')
self.assertEquals('default_transformation_rule', \ self.assertEquals('default_transformation_rule', \
applied_rule.getSpecialiseReference()) applied_rule.getSpecialiseReference())
# Test deeper simulation # Test deeper simulation
...@@ -843,7 +854,7 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -843,7 +854,7 @@ class TestProductionOrderMixin(TestOrderMixin):
simulation_movement_list = sequence.get('simulation_movement_list') simulation_movement_list = sequence.get('simulation_movement_list')
self.assertEquals(1, len(simulation_movement_list)) self.assertEquals(1, len(simulation_movement_list))
order_line = sequence.get('order_line') order_line = sequence.get('order_line')
related_simulation_movement_list = order_line.getOrderRelatedValueList() related_simulation_movement_list = order_line.getDeliveryRelatedValueList()
self.assertEquals(1, len(related_simulation_movement_list)) self.assertEquals(1, len(related_simulation_movement_list))
related_simulation_movement = related_simulation_movement_list[0] related_simulation_movement = related_simulation_movement_list[0]
self.assertEquals(related_simulation_movement, self.assertEquals(related_simulation_movement,
...@@ -862,7 +873,7 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -862,7 +873,7 @@ class TestProductionOrderMixin(TestOrderMixin):
(production_organisation1, 'getSourceValue'), (production_organisation1, 'getSourceValue'),
(production_organisation1, 'getSourceSectionValue'))) (production_organisation1, 'getSourceSectionValue')))
# Test next applied rule # Test next applied rule
applied_rule_list = related_simulation_movement.objectValues() applied_rule_list = related_simulation_movement.objectValues()[0].objectValues()[0].objectValues()
self.assertEquals(1, len(applied_rule_list)) self.assertEquals(1, len(applied_rule_list))
applied_rule = applied_rule_list[0] applied_rule = applied_rule_list[0]
self.assertEquals("Applied Rule", applied_rule.getPortalType()) self.assertEquals("Applied Rule", applied_rule.getPortalType())
...@@ -951,7 +962,7 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -951,7 +962,7 @@ class TestProductionOrderMixin(TestOrderMixin):
operation_movement = operation_movement, operation_movement = operation_movement,
component_movement = component_movement, component_movement = component_movement,
supply_movement = supply_movement, supply_movement = supply_movement,
produced_delivery_movement = related_simulation_movement, produced_delivery_movement = related_simulation_movement.objectValues()[0].objectValues()[0],
) )
def stepCreateProductionOrganisation2(self, sequence=None, def stepCreateProductionOrganisation2(self, sequence=None,
...@@ -1044,7 +1055,7 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -1044,7 +1055,7 @@ class TestProductionOrderMixin(TestOrderMixin):
simulation_movement_list = sequence.get('simulation_movement_list') simulation_movement_list = sequence.get('simulation_movement_list')
self.assertEquals(1, len(simulation_movement_list)) self.assertEquals(1, len(simulation_movement_list))
order_line = sequence.get('order_line') order_line = sequence.get('order_line')
related_simulation_movement_list = order_line.getOrderRelatedValueList() related_simulation_movement_list = order_line.getDeliveryRelatedValueList()
self.assertEquals(1, len(related_simulation_movement_list)) self.assertEquals(1, len(related_simulation_movement_list))
related_simulation_movement = related_simulation_movement_list[0] related_simulation_movement = related_simulation_movement_list[0]
self.assertEquals(related_simulation_movement, self.assertEquals(related_simulation_movement,
......
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