2 In Order to test process of Recruitment,
4 Applicant interested in job position. so He send resume by email.
6 !python {model: mail.thread}: |
8 request_file = open(addons.get_module_resource('hr_recruitment','test', 'resume.eml'),'rb')
9 request_message = request_file.read()
10 self.message_process(cr, uid, 'hr.applicant', request_message)
12 After getting the mail, I check details of new applicant.
14 !python {model: hr.applicant}: |
15 applicant_ids = self.search(cr, uid, [('email_from','=', 'Mr. Richard Anderson <Richard_Anderson@yahoo.com>')])
16 assert applicant_ids, "Applicant is not created after getting the mail"
17 applicant = self.browse(cr, uid, applicant_ids[0], context=context)
18 resume_ids = self.pool.get('ir.attachment').search(cr, uid, [('datas_fname','=','resume.doc'),('res_model','=',self._name),('res_id','=',applicant.id)])
19 assert applicant.name == "Application for the post of Jr.application Programmer.", "Subject does not match"
20 assert applicant.state == "draft"
21 assert len(resume_ids), "Resume does not attached."
23 I Refuse applicant for the Recruitment.
25 !python {model: hr.applicant}: |
26 self.case_close(cr, uid, [ref("hr_case_programmer")])
28 I open applicant for the Recruitment.
30 !python {model: hr.applicant}: |
31 self.case_reset(cr, uid, [ref("hr_case_programmer")])
32 self.case_open(cr, uid, [ref("hr_case_programmer")])
34 I assign the Job position to the applicant
36 !python {model: hr.applicant}: |
37 context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")})
38 self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')})
40 I start communication with applicant, first schedule phonecall.
42 !python {model: hr.recruitment.job2phonecall}: |
43 context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")})
44 id = self.create(cr, uid, {}, context=context)
45 self.make_phonecall(cr, uid, [id], context=context)
47 I schedule meeting with applicant for interview.
49 !python {model: hr.applicant}: |
50 self.action_makeMeeting(cr, uid, [ref('hr_case_programmer')])
52 I check Initial Qualification of applicant.
54 !python {model: hr.applicant}: |
55 self.stage_next(cr, uid, [ref('hr_case_programmer')])
57 I schedule First Interview of applicant.
59 !python {model: hr.applicant}: |
60 self.stage_next(cr, uid, [ref('hr_case_programmer')])
62 On a successful First Interview of applicant, I schedule Second Interview.
64 !python {model: hr.applicant}: |
65 self.stage_next(cr, uid, [ref('hr_case_programmer')])
67 Applicant fillup the answer of the interview quetion.
69 !python {model: survey.question.wiz}: |
71 ctx.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")})
72 self.fields_view_get(cr, uid, ref("survey.view_survey_question_message"),"form", context=ctx)
73 vals = self.default_get(cr, uid , [], context=ctx)
74 self.create(cr, uid, vals, context=ctx)
75 self.action_new_page(cr, uid, [ref("survey_job_0")], context=ctx)
77 I print Applicant fill up the interview quetion
79 !python {model: hr.applicant}: |
80 self.action_print_survey(cr, uid, [ref('hr_case_programmer')])
82 On a successful Second Interview of applicant Contract is Proposed to applicant.
84 !python {model: hr.applicant}: |
85 self.stage_next(cr, uid, [ref('hr_case_programmer')])
86 self.stage_previous(cr, uid, [ref('hr_case_programmer')])
90 !python {model: hr.applicant}: |
91 self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')])
92 context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
94 I check that applicant is "Hired".
96 !assert {model: hr.applicant, id: hr_case_programmer}:
99 I Not give Employeement to Hired Aplicant till.
101 !python {model: hired.employee}: |
102 context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
103 emp_id = self.create(cr, uid, {}, context=context)
104 self.case_close(cr, uid, [emp_id], context=context)
106 Now I give Employeement to Hired Applicant .
108 !python {model: hr.applicant}: |
109 self.case_reset(cr, uid, [ref("hr_case_programmer")])
110 self.case_open(cr, uid, [ref("hr_case_programmer")])
111 context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
113 !python {model: hired.employee}: |
114 context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
115 emp_hr_id = self.create(cr, uid, {}, context=context)
116 self.case_close_with_emp(cr, uid, [emp_hr_id], context=context)
118 Now Hired Employee want to be a Partner of Company.
120 !record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_id1 }:
122 !python {model: hr.recruitment.partner.create}: |
123 context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
124 self.make_order(cr, uid, [ref("hr_recruitment_partner_id1")], context=context)