Commit b7050e5c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

revise for new simulation rules.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33394 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b3acec03
...@@ -49,7 +49,7 @@ class TestERP5SimulationMixin(TestInvoiceMixin): ...@@ -49,7 +49,7 @@ class TestERP5SimulationMixin(TestInvoiceMixin):
def afterSetUp(self, quiet=1, run=1): def afterSetUp(self, quiet=1, run=1):
TestInvoiceMixin.afterSetUp(self) TestInvoiceMixin.afterSetUp(self)
portal_rules = self.portal.portal_rules portal_rules = self.portal.portal_rules
for rule in portal_rules.objectValues(portal_type='Order Rule'): for rule in portal_rules.objectValues(portal_type='Order Root Simulation Rule'):
if rule.getValidationState() == 'validated': if rule.getValidationState() == 'validated':
rule.invalidate() rule.invalidate()
self.validateNewRules() self.validateNewRules()
...@@ -122,8 +122,8 @@ class TestERP5SimulationMixin(TestInvoiceMixin): ...@@ -122,8 +122,8 @@ class TestERP5SimulationMixin(TestInvoiceMixin):
# create an Order Rule document. # create an Order Rule document.
portal_rules = self.portal.portal_rules portal_rules = self.portal.portal_rules
new_order_rule = filter( new_order_rule = filter(
lambda x:x.title == 'New Default Order Rule', lambda x:x.title == 'New Default Order Root Simulation Rule',
portal_rules.objectValues(portal_type='Order Rule'))[0] portal_rules.objectValues(portal_type='Order Root Simulation Rule'))[0]
if new_order_rule.getValidationState() != 'validated': if new_order_rule.getValidationState() != 'validated':
new_order_rule.validate() new_order_rule.validate()
...@@ -371,13 +371,13 @@ class TestERP5SimulationMixin(TestInvoiceMixin): ...@@ -371,13 +371,13 @@ class TestERP5SimulationMixin(TestInvoiceMixin):
self.assertEquals(len(unique_movement_list), self.assertEquals(len(unique_movement_list),
len(simulation_movement_list)) len(simulation_movement_list))
# Check if all movements are related to simulation movements # Check if all movements are related to simulation movements
order_movement_list = sum([x.getOrderValueList() for x in \ order_movement_list = sum([x.getDeliveryValue() for x in \
simulation_movement_list], []) simulation_movement_list], [])
self.failIfDifferentSet(movement_list, order_movement_list) self.failIfDifferentSet(movement_list, order_movement_list)
# Check each simulation movement # Check each simulation movement
for simulation_movement in simulation_movement_list: for simulation_movement in simulation_movement_list:
order_movement_list = simulation_movement.getOrderValueList() order_movement_list = simulation_movement.getDeliveryValueList()
# Test quantity # Test quantity
self.assertEquals(sum([x.getQuantity() for x in order_movement_list]), self.assertEquals(sum([x.getQuantity() for x in order_movement_list]),
simulation_movement.getQuantity()) simulation_movement.getQuantity())
......
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