[MERGE] merge with latest stable
[odoo/odoo.git] / addons / hr_recruitment / test / test_hr_recruitment.yml
1 -
2   In order to test hr_recruitment module for OpenERP, I will create applicants form, Manages job positions and the recruitment process.
3 -
4
5   I create a department.
6 -
7   !record {model: hr.department, id: hr_department_rd0}:
8     manager_id: base.user_root
9     name: 'R & D '
10
11 -
12   I create new Job Position.
13 -
14   !record {model: hr.job, id: hr_job_jea0}:
15     department_id: 'hr_department_rd0'
16     description: 'Position of Jr. Application Engineer'
17     expected_employees: 5
18     name: 'JAE '
19 -
20   I create a recruitment stage "Initial Jobs Demand".
21 -
22   !record {model: hr.recruitment.stage, id: hr_recrutiment_stage_first0}:
23     name: 'Initial Jobs Demand'
24     sequence: 1
25 -
26   I create an applicant.
27 -
28   !record {model: hr.applicant, id: hr_applicant_fresher0}:
29     availability: 0.0
30     department_id: hr.dep_it
31     name: Fresher
32     partner_address_id: base.res_partner_address_tang
33     partner_id: base.res_partner_asus
34     partner_name: Marion Jones
35     partner_phone: '1111112223'
36     response: 0.0
37     salary_expected: 0.0
38     salary_proposed: 0.0
39     stage_id: hr_recrutiment_stage_first0
40     type_id: hr_recruitment.degree_licenced
41
42 -
43   I check that applicant is on "draft" state.
44 -
45   !assert {model: hr.applicant, id:  hr_applicant_fresher0}:
46     - state == 'draft'
47
48 -
49   I change the state by click on "In Progress" button.
50 -
51   !python {model: hr.applicant}: |
52     self.case_open(cr, uid, [ref("hr_applicant_fresher0")], {"active_ids": [ref("hr_recruitment.menu_crm_case_categ0_act_job")],
53       })
54
55 -
56   I create a new case category.
57 -
58   !record {model: crm.case.categ, id: crm_case_categ_employee0}:
59     name: 'Employee'
60
61 -
62   I schedule a phonecall for this applicant by click on "Schedule a Phone Call" button.
63 -
64   !record {model: hr.recruitment.job2phonecall, id: hr_recruitment_forinterview0}:
65     user_id: base.user_root
66     deadline: !eval time.strftime('%Y-%m-%d 11:51:00')
67     note: 'For interview.'
68     category_id: 'crm_case_categ_employee0'
69
70 -
71   I click on "Schedule phonecall" button of this wizard.
72 -
73   !python {model: hr.recruitment.job2phonecall}: |
74      self.make_phonecall(cr, uid, [ref('hr_recruitment_forinterview0')], {'active_ids': [ref('hr_applicant_fresher0')]})
75
76 -
77   I schedule meeting for interview of this applicant by click on "Schedule Meeting" button.
78 -
79   !python {model: hr.applicant}: |
80      self.action_makeMeeting(cr, uid, [ref('hr_recruitment_forinterview0')])
81 -
82   I create an entry for the meeting with the applicant.
83 -
84   !record {model: crm.meeting, id: crm_meeting_fresher0}:
85     alarm_id: base_calendar.alarm1
86     count: 0.0
87     date: !eval "(datetime.now()+timedelta(1)).strftime('%Y-%m-%d 00:00:00')"
88     date_deadline: !eval "(datetime.now()+timedelta(1)).strftime('%Y-%m-%d 08:00:00')"
89     day: 0.0
90     duration: 8.0
91     name: Fresher
92     opportunity_id: crm.crm_case_construstazunits0
93     partner_address_id: base.res_partner_address_tang
94     partner_id: base.res_partner_asus
95     recurrent_uid: 0.0
96     rrule_type: none
97     state: open
98     user_id: base.user_root
99
100 -
101   On a successful meeting with the applicant, I hired employee by click on "Hired" button.
102 -
103   !python {model: hr.applicant}: |
104      self.case_close(cr, uid, [ref('hr_applicant_fresher0')])
105 -
106   I check that applicant state is "Hired".
107 -
108   !assert {model: hr.applicant, id: hr_applicant_fresher0}:
109     - state == 'done'