Commit b3d1dd49 authored by Sebastien Robin's avatar Sebastien Robin

* use new API to make test_03_TaskReportChangeStartDate working

  with new simulation
* backport some unit test code in order to have legacy tests
  still passing with old simulation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44241 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 545208ec
......@@ -113,12 +113,16 @@ class TestTaskReportDivergenceMixin(TestTaskMixin):
def stepAcceptDateDecision(self, sequence=None, **kw):
task_report = sequence.get('task_report')
# XXX This is not really cool, when we will have nice api, it is required
# to use it
self.getPortal().portal_deliveries\
.task_report_builder.solveDeliveryGroupDivergence(
task_report.getRelativeUrl(),
property_dict={'start_date':[self.datetime + 15]})
solver_process_tool = self.portal.portal_solver_processes
solver_process = solver_process_tool.newSolverProcess(task_report)
solver_decision, = [x for x in solver_process.contentValues()
if x.getCausalityValue().getTestedProperty() == 'start_date']
# use Quantity Accept Solver.
solver_decision.setSolverValue(self.portal.portal_solvers['Accept Solver'])
# configure for Accept Solver.
solver_decision.updateConfiguration(tested_property_list=['start_date'], **kw)
solver_process.buildTargetSolverList()
solver_process.solve()
def stepCheckCommentStillOnTaskReport(self, sequence=None, **kw):
"""
......@@ -196,7 +200,6 @@ class TestTaskReportDivergence(TestTaskReportDivergenceMixin, ERP5TypeTestCase)
sequence_list.play(self, quiet=quiet)
@newSimulationExpectedFailure
def test_03_TaskReportChangeStartDate(self, quiet=quiet, run=run_all_test):
"""
Test generation of delivery list
......
......@@ -49,6 +49,18 @@ Legacy_getBusinessTemplateList(TestTaskMixin)
TestTaskReporting.createBusinessProcess = lambda self: None
Legacy_getBusinessTemplateList(TestTaskReporting)
def stepAcceptDateDecision(self, sequence=None, **kw):
task_report = sequence.get('task_report')
# XXX This is not really cool, when we will have nice api, it is required
# to use it
self.getPortal().portal_deliveries\
.task_report_builder.solveDeliveryGroupDivergence(
task_report.getRelativeUrl(),
property_dict={'start_date':[self.datetime + 15]})
TestTaskReportDivergenceMixin.stepAcceptDateDecision = stepAcceptDateDecision
def test_suite():
suite = test_suite_list[0]()
for test_suite in test_suite_list[1:]:
......
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