Merge branch 'master' of https://github.com/odoo/odoo
[odoo/odoo.git] / addons / hr_evaluation / test / test_hr_evaluation.yml
1 # -
2 #   I check that state of "Employee Evaluation" survey is Open.
3 # -
4 #   !assert {model: survey.survey, id: appraisal_form, severity: error, string: Survey should be in 'open' state}:
5 #     - state == 'open'
6 # -
7 #   I start the evaluation process by click on "Start Evaluation" button.
8 # -
9 #   !python {model: hr_evaluation.evaluation}: |
10 #      self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
11 # -
12 #   I check that state is "Plan in progress".
13 # -
14 #   !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be 'Plan in progress' state}:
15 #     - state == 'wait'
16 # -
17 #   I find a mistake on evaluation form. So I cancel the evaluation and again start it.
18 # -
19 #   !python {model: hr_evaluation.evaluation}: |
20 #     evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context)
21 #     self.button_cancel(cr, uid, [ref('hr_evaluation_evaluation_0')])
22 #     assert evaluation.state == 'cancel', 'Evaluation should be in cancel state'
23 #     self.button_draft(cr, uid, [ref('hr_evaluation_evaluation_0')])
24 #     evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context)
25 #     assert evaluation.state == 'draft', 'Evaluation should be in draft state'
26 #     self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
27 # -
28 #   I check that state is "Plan in progress" and "Interview Request" record is created
29 # -
30 #   !python {model: hr_evaluation.evaluation}: |
31 #     interview_obj = self.pool.get('hr.evaluation.interview')
32 #     evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context)
33 #     assert evaluation.state == 'wait', "Evaluation should be 'Plan in progress' state"
34 #     interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))])
35 #     assert len(interview_ids), "Interview evaluation survey not created"
36 # -
37 #   Give answer of the first page in "Employee Evaluation" survey.
38 # -
39 #   !python {model: survey.question.wiz}: |
40 #     name_wiz_obj=self.pool.get('survey.name.wiz')
41 #     interview_obj = self.pool.get('hr.evaluation.interview')
42 #     interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))])
43 #     assert len(interview_ids), "Interview evaluation survey not created"
44 #     ctx = {'active_model':'hr.evaluation.interview', 'active_id': interview_ids[0], 'active_ids': [interview_ids], 'survey_id': ref("survey_2")}
45 #     name_id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_2")})
46 #     ctx ["sur_name_id"] = name_id
47 #     self.create(cr, uid, {str(ref("survey_question_2")) +"_" +str(ref("survey_answer_1")) + "_multi" :'tpa',
48 #                 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_10")) + "_multi" :'application eng',
49 #                 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_20")) + "_multi" :'3',
50 #                 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_25")) + "_multi" :'2011-12-02 16:42:00',
51 #                 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_43")) + "_multi" :'HR',
52 #                 }, context = ctx)
53 # -
54 #   I close this Evaluation survey by giving answer of questions.
55 # -
56 #   !python {model: hr_evaluation.evaluation}: |
57 #     interview_obj = self.pool.get('hr.evaluation.interview')
58 #     evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0'))
59 #     interview_obj.survey_req_done(cr, uid, [r.id for r in evaluation.survey_request_ids])
60 #     for survey in evaluation.survey_request_ids:
61 #       interview = interview_obj.browse(cr, uid, survey.id, context)
62 #       assert interview.state == "done", 'survey must be in done state'
63 # -
64 #   I print the evaluation.
65 # -
66 #   !python {model: hr_evaluation.evaluation}: |
67 #     evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0'))
68 #     self.pool.get('hr.evaluation.interview').action_print_survey(cr, uid, [r.id for r in evaluation.survey_request_ids])
69 # -
70 #   I click on "Final Validation" button to finalise evaluation.
71 # -
72 #   !python {model: hr_evaluation.evaluation}: |
73 #     self.button_final_validation(cr, uid, [ref("hr_evaluation_evaluation_0")])
74 # -
75 #   I check that state is "Waiting Appreciation".
76 # -
77 #   !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
78 #       - state == 'progress'
79 # -
80 #   Give Rating "Meet expectations" by selecting overall Rating.
81 # -
82 #   !record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
83 #     rating: '2'
84 # -
85 #   I close this Evaluation by click on "Done" button of this wizard.
86 # -
87 #   !python {model: hr_evaluation.evaluation}: |
88 #     self.button_done(cr, uid, [ref("hr_evaluation_evaluation_0")])
89 # -
90 #   I check that state of Evaluation is done.
91 # -
92 #   !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in done state}:
93 #       - state == 'done'
94 # -
95 #   Print Evaluations Statistics Report
96 # -
97 #   !python {model: hr.evaluation.report}: |
98 #     import os, time
99 #     from openerp import tools
100 #     ctx={}
101 #     data_dict={'state': 'done', 'rating': 2, 'employee_id': ref("hr.employee_fp")}
102 #     from openerp.tools import test_reports
103 #     test_reports.try_report_action(cr, uid, 'hr_evaluation_evaluation_0',wiz_data=data_dict, context=ctx, our_module='hr_evaluation')