From 2c6a90384bb93553e4c101b38939f13190d017f8 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Tue, 13 Dec 2011 10:50:12 +0530 Subject: [PATCH] [IMP] added task_process.yml for task sheduling in project_long_term module bzr revid: tpa@tinyerp.com-20111213052012-6eo11iszu07yo0mt --- addons/project_long_term/__openerp__.py | 1 + addons/project_long_term/test/task_process.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 addons/project_long_term/test/task_process.yml diff --git a/addons/project_long_term/__openerp__.py b/addons/project_long_term/__openerp__.py index c884718..e53fed2 100644 --- a/addons/project_long_term/__openerp__.py +++ b/addons/project_long_term/__openerp__.py @@ -44,6 +44,7 @@ Features "demo_xml": ["project_long_term_demo.xml"], "test": [ 'test/phase_process.yml', + 'test/task_process.yml', ], "update_xml": [ "security/ir.model.access.csv", diff --git a/addons/project_long_term/test/task_process.yml b/addons/project_long_term/test/task_process.yml new file mode 100644 index 0000000..f31d9689 --- /dev/null +++ b/addons/project_long_term/test/task_process.yml @@ -0,0 +1,20 @@ +- + I create a record to compute the tasks of project. +- + !record {model: project.compute.tasks, id: project_compute_tasks0}: + project_id: project.project_integrate_openerp +- + I compute and shedule the tasks. +- + !python {model: project.compute.tasks}: | + self.compute_date(cr, uid, [ref("project_compute_tasks0")]) +- + Check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null +- + !python {model: project.project}: | + prj = self.browse(cr, uid, [ref("project.project_integrate_openerp")])[0] + for task in prj.tasks: + if task.state in ('done','cancelled'): + continue + if (not task.user_id) or (not task.date_start) or (not task.date_end): + raise AssertionError("Project tasks not scheduled!") \ No newline at end of file -- 1.7.10.4