Commit 11dcdb98 authored by Julien Muchembled's avatar Julien Muchembled

testPackingList: remove useless method

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@38112 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7511be13
...@@ -963,8 +963,8 @@ class TestInvoiceMixin(TestPackingListMixin, ...@@ -963,8 +963,8 @@ class TestInvoiceMixin(TestPackingListMixin,
def stepUnifyStartDateWithDecisionInvoice(self, sequence=None, def stepUnifyStartDateWithDecisionInvoice(self, sequence=None,
sequence_list=None): sequence_list=None):
invoice = sequence.get('invoice') invoice = sequence.get('invoice')
self._solveDeliveryGroupDivergence(invoice, 'start_date', self._solveDivergence(invoice, 'start_date', 'Unify Solver',
'Unify Solver', value=invoice.getStartDate()) value=invoice.getStartDate())
def stepAcceptDecisionQuantityInvoice(self,sequence=None, sequence_list=None): def stepAcceptDecisionQuantityInvoice(self,sequence=None, sequence_list=None):
invoice = sequence.get('invoice') invoice = sequence.get('invoice')
......
...@@ -651,16 +651,15 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -651,16 +651,15 @@ class TestPackingListMixin(TestOrderMixin):
Check if simulation movement are disconnected Check if simulation movement are disconnected
""" """
packing_list = sequence.get('packing_list') packing_list = sequence.get('packing_list')
self._solveDeliveryGroupDivergence(packing_list, 'destination', self._solveDivergence(packing_list, 'destination', 'Accept Solver')
'Accept Solver')
def stepUnifyStartDateWithDecision(self,sequence=None, sequence_list=None, **kw): def stepUnifyStartDateWithDecision(self,sequence=None, sequence_list=None, **kw):
""" """
Check if simulation movement are disconnected Check if simulation movement are disconnected
""" """
packing_list = sequence.get('packing_list') packing_list = sequence.get('packing_list')
self._solveDeliveryGroupDivergence(packing_list, 'start_date', self._solveDivergence(packing_list, 'start_date', 'Unify Solver',
'Unify Solver', value=packing_list.getStartDate()) value=packing_list.getStartDate())
def stepUnifyStopDateWithDecision(self,sequence=None, sequence_list=None, **kw): def stepUnifyStopDateWithDecision(self,sequence=None, sequence_list=None, **kw):
""" """
...@@ -675,7 +674,7 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -675,7 +674,7 @@ class TestPackingListMixin(TestOrderMixin):
packing_list = sequence.get('packing_list') packing_list = sequence.get('packing_list')
applied_rule = sequence.get('applied_rule') applied_rule = sequence.get('applied_rule')
simulation_movement_list = applied_rule.objectValues() simulation_movement_list = applied_rule.objectValues()
self._solveDeliveryGroupDivergence(packing_list, 'start_date', self._solveDivergence(packing_list, 'start_date',
'Unify Solver', value=simulation_movement_list[-1].getStartDate()) 'Unify Solver', value=simulation_movement_list[-1].getStartDate())
def stepUnifyStopDateWithPrevision(self,sequence=None, sequence_list=None, **kw): def stepUnifyStopDateWithPrevision(self,sequence=None, sequence_list=None, **kw):
...@@ -684,19 +683,6 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -684,19 +683,6 @@ class TestPackingListMixin(TestOrderMixin):
""" """
raise NotImplementedError raise NotImplementedError
def _solveDeliveryGroupDivergence(self, document, property, solver, **kw):
solver_process_tool = self.portal.portal_solver_processes
solver_process = solver_process_tool.newSolverProcess(document)
for solver_decision in solver_process.contentValues():
if solver_decision.getCausalityValue().getTestedProperty() == property:
# use Quantity Accept Solver.
solver_decision.setSolverValue(self.portal.portal_solvers[solver])
# configure for Accept Solver.
solver_decision.updateConfiguration(tested_property_list=[property],
**kw)
solver_process.buildTargetSolverList()
solver_process.solve()
def stepAcceptDecisionResource(self,sequence=None, sequence_list=None, **kw): def stepAcceptDecisionResource(self,sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('packing_list') packing_list = sequence.get('packing_list')
self._solveDivergence(packing_list, 'resource', 'Accept Solver') self._solveDivergence(packing_list, 'resource', 'Accept Solver')
...@@ -713,7 +699,7 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -713,7 +699,7 @@ class TestPackingListMixin(TestOrderMixin):
packing_list = sequence.get('packing_list') packing_list = sequence.get('packing_list')
self._solveDivergence(packing_list, 'quantity', 'Adopt Solver') self._solveDivergence(packing_list, 'quantity', 'Adopt Solver')
def _solveDivergence(self, document, property, solver): def _solveDivergence(self, document, property, solver, **kw):
"""Solve divergence by using solver tool""" """Solve divergence by using solver tool"""
solver_process_tool = self.portal.portal_solver_processes solver_process_tool = self.portal.portal_solver_processes
solver_process = solver_process_tool.newSolverProcess(document) solver_process = solver_process_tool.newSolverProcess(document)
...@@ -722,7 +708,7 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -722,7 +708,7 @@ class TestPackingListMixin(TestOrderMixin):
# use Quantity Accept Solver. # use Quantity Accept Solver.
solver_decision.setSolverValue(self.portal.portal_solvers[solver]) solver_decision.setSolverValue(self.portal.portal_solvers[solver])
# configure for Accept Solver. # configure for Accept Solver.
solver_decision.updateConfiguration(tested_property_list=[property]) solver_decision.updateConfiguration(tested_property_list=[property], **kw)
solver_process.buildTargetSolverList() solver_process.buildTargetSolverList()
solver_process.solve() solver_process.solve()
......
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