diff options
Diffstat (limited to 'addons/project/test/task_process.yml.THIS')
| -rw-r--r-- | addons/project/test/task_process.yml.THIS | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/addons/project/test/task_process.yml.THIS b/addons/project/test/task_process.yml.THIS new file mode 100644 index 00000000000..664f0b1563e --- /dev/null +++ b/addons/project/test/task_process.yml.THIS @@ -0,0 +1,81 @@ +- + Test the whole task process with project user. +- + !context + uid: 'res_users_project_user' +- + I put task in pending due to specification is not clear. +- + !python {model: project.task}: | + self.do_pending(cr, uid, [ref("project_task_for_project1")]) + context.update({"active_id": ref("project_task_for_project1")}) +- + I check state of task after put in pending. +- + !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be in pending state}: + - state == "pending" +- + !record {model: project.task.delegate, id: delegate_id}: + user_id: res_users_project_user + planned_hours: 12.0 + planned_hours_me: 2.0 +- + Now I delegate task to team member. +- + !python {model: project.task.delegate}: | + self.delegate(cr, uid, [ref("delegate_id")], {"active_id": ref("project_task_for_project1")}) +- + I check delegated task details. +- + !python {model: project.task}: | + task = self.browse(cr, uid, ref("project_task_for_project1"), context=context) + assert task.planned_hours == 2.0, "Planning hours is not correct after delegated." + assert task.state == "pending", "Task should be in Pending after delegated." +- + I re-open the task. +- + !python {model: project.task}: | + self.do_reopen(cr, uid, [ref("project_task_for_project1")]) +- + I check reopened task details. +- + !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be open.}: + - state == "open" +- + I change the stage of task to next stage. +- + !python {model: project.task}: | + self.stage_next(cr, uid, [ref("project_task_for_project1")]) +- + !record {model: project.task.reevaluate, id: reevaluate_id}: + remaining_hours : 120 +- + I reevaluate task with remaining hours. +- + !python {model: project.task.reevaluate}: | + self.compute_hours(cr, uid, [ref("reevaluate_id")], {"active_id": ref("project_task_for_project1")}) +- + I check remaining hours after reevaluated task. +- + !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be reevaluated}: + - remaining_hours == 120.0 +- + I close the task. +- + !python {model: project.task}: | + self.action_close(cr, uid, [ref("project_task_for_project1")]) +- + I check state after closed. +- + !assert {model: project.task, id: project_task_for_project1, severity: error, string: task is in open state}: + - state == "done" +- + I change the stage of task to previous stage. +- + !python {model: project.task}: | + self.stage_previous(cr, uid, [ref("project_task_for_project1")]) +- + I cancel Task. +- + !python {model: project.task}: | + self.do_cancel(cr, uid, [ref("project_task_for_project1")]) |
