Commit c6aa35b4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

no need to override these steps.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33441 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dbb7fe6a
......@@ -330,95 +330,6 @@ class TestERP5SimulationMixin(TestInvoiceMixin):
solver_process.buildTargetSolverList()
solver_process.solve()
def checkOrderRuleSimulation(self, rule_reference, sequence=None, sequence_list=None):
"""
Test if simulation is matching order, be sure that rule_reference is used
to expand simulation for order
"""
order = sequence.get('order')
related_applied_rule_list = order.getCausalityRelatedValueList( \
portal_type=self.applied_rule_portal_type)
no_applied_rule_state = ('draft', 'auto_planned')
order_state = order.getSimulationState()
if order_state in no_applied_rule_state:
self.assertEquals(0, len(related_applied_rule_list))
else:
LOG('stepCheckOrderRuleSimulation', 0, 'related_applied_rule_list: %s' %
str([x.getObject() for x in related_applied_rule_list]))
self.assertEquals(1, len(related_applied_rule_list))
applied_rule = related_applied_rule_list[0].getObject()
sequence.edit(applied_rule=applied_rule)
self.failUnless(applied_rule is not None)
self.failUnless(order_state, \
applied_rule.getLastExpandSimulationState())
# Test if applied rule has a specialise value with passed rule_reference
portal_rules = getToolByName(order, 'portal_rules')
self.assertEquals(rule_reference,
applied_rule.getSpecialiseReference())
simulation_movement_list = applied_rule.objectValues()
sequence.edit(simulation_movement_list=simulation_movement_list)
# Count the number of movement in order
movement_list = order.getMovementList()
# Check if number of unique movement is equal to number of
# simulation movement
unique_movement_list = dict(
[('%r,%r,%r' % (x.getResource(), x.getVariationCategoryList(),
x.getVariationPropertyDict())), x] for x in movement_list).values()
self.assertEquals(len(unique_movement_list),
len(simulation_movement_list))
# Check if all movements are related to simulation movements
order_movement_list = sum([x.getDeliveryValueList() for x in \
simulation_movement_list], [])
self.failIfDifferentSet(movement_list, order_movement_list)
# Check each simulation movement
for simulation_movement in simulation_movement_list:
order_movement_list = simulation_movement.getDeliveryValueList()
# Test quantity
self.assertEquals(sum([x.getQuantity() for x in order_movement_list]),
simulation_movement.getQuantity())
for order_movement in order_movement_list:
# Test price
self.assertEquals(order_movement.getPrice(), \
simulation_movement.getPrice())
# Test resource
self.assertEquals(order_movement.getResource(), \
simulation_movement.getResource())
# Test resource variation
self.assertEquals(order_movement.getVariationText(), \
simulation_movement.getVariationText())
self.assertEquals(order_movement.getVariationCategoryList(), \
simulation_movement.getVariationCategoryList())
# XXX Test acquisition
self.checkAcquisition(simulation_movement, order_movement)
def stepModifySimulationLineQuantityForMergedLine(self,sequence=None, sequence_list=None):
"""
Check if simulation movement are disconnected
"""
applied_rule = sequence.get('applied_rule')
simulation_line_list = applied_rule.objectValues()
self.assertEquals(len(simulation_line_list), 1)
for simulation_line in simulation_line_list:
simulation_line.edit(quantity=self.default_quantity-2)
simulation_line.getDeliveryValue().edit(quantity=self.default_quantity-2)
def stepCheckSimulationQuantityUpdatedForMergedLine(self,sequence=None, sequence_list=None):
"""
Test if the quantity of the simulation movement was changed
"""
applied_rule = sequence.get('applied_rule')
simulation_line_list = applied_rule.objectValues()
self.assertEquals(len(simulation_line_list), 1)
for simulation_line in simulation_line_list:
self.assertEquals(simulation_line.getQuantity() + \
simulation_line.getDeliveryError(),
self.default_quantity * 2)
def stepCheckPackingListLineWithDifferentResource(self,sequence=None, sequence_list=None):
"""
Look if the packing list has new previsions
......
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