From 46d972e6b0e0da3a78fd97fe14ccba870b433588 Mon Sep 17 00:00:00 2001 From: "Richard Mathot (OpenERP)" Date: Tue, 4 Mar 2014 15:43:08 +0100 Subject: [PATCH] [WIP][FIX] Partial fix of the tests of hr_evaluation bzr revid: rim@openerp.com-20140304144308-76b08pktexfklj66 --- .../hr_evaluation/test/test_hr_evaluation.yml | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml index 3244e37302e..6ac872d2edd 100644 --- a/addons/hr_evaluation/test/test_hr_evaluation.yml +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -1,12 +1,12 @@ - I set the "Employee Evaluation" survey in open state. - - !python {model: survey}: | + !python {model: survey.survey}: | self.survey_open(cr, uid, [ref("survey_2")], context) - I check that state of "Employee Evaluation" survey is Open. - - !assert {model: survey, id: survey_2, severity: error, string: Survey should be in OPen state}: + !assert {model: survey.survey, id: survey_2, severity: error, string: Survey should be in OPen state}: - state == 'open' - I start the evaluation process by click on "Start Evaluation" button. @@ -38,33 +38,6 @@ assert evaluation.state == 'wait', "Evaluation should be 'Plan in progress' state" interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))]) assert len(interview_ids), "Interview evaluation survey not created" -- - Give answer of the first page in "Employee Evaluation" survey. -- - !python {model: survey.question.wiz}: | - name_wiz_obj=self.pool.get('survey.name.wiz') - interview_obj = self.pool.get('hr.evaluation.interview') - interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))]) - assert len(interview_ids), "Interview evaluation survey not created" - ctx = {'active_model':'hr.evaluation.interview', 'active_id': interview_ids[0], 'active_ids': [interview_ids], 'survey_id': ref("survey_2")} - name_id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_2")}) - ctx ["sur_name_id"] = name_id - self.create(cr, uid, {str(ref("survey_question_2")) +"_" +str(ref("survey_answer_1")) + "_multi" :'tpa', - str(ref("survey_question_2")) +"_" +str(ref("survey_answer_10")) + "_multi" :'application eng', - str(ref("survey_question_2")) +"_" +str(ref("survey_answer_20")) + "_multi" :'3', - str(ref("survey_question_2")) +"_" +str(ref("survey_answer_25")) + "_multi" :'2011-12-02 16:42:00', - str(ref("survey_question_2")) +"_" +str(ref("survey_answer_43")) + "_multi" :'HR', - }, context = ctx) -- - I close this Evaluation survey by giving answer of questions. -- - !python {model: hr_evaluation.evaluation}: | - interview_obj = self.pool.get('hr.evaluation.interview') - evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0')) - interview_obj.survey_req_done(cr, uid, [r.id for r in evaluation.survey_request_ids]) - for survey in evaluation.survey_request_ids: - interview = interview_obj.browse(cr, uid, survey.id, context) - assert interview.state == "done", 'survey must be in done state' - I print the evaluation. -