[IMP] Small improvements
[odoo/odoo.git] / addons / hr / test / open2recruit2close_job.yml
1 -
2   Give the access rights of Hr Officer to the user to test the process of Human Resource Management.
3 -
4   !context
5     uid: 'res_users_hr_officer'
6 -
7   In order to test the process of Human Resource Management, I open Job Postion for "Developer".
8
9   !python {model: hr.job}: |
10     self.job_open(cr, uid, [ref('job_developer')])
11 -
12   I check state of Job Position after opening it.
13 -
14   !assert {model: hr.job, id: job_developer, string: Job position is in 'open' state and no_of_recruitment = 0}:
15     - state == 'open'
16     - no_of_recruitment == 0
17 -
18   Now, Recruitement is started so I start recruitement of Job Postion of "Developer" Profile.
19 -    
20   !python {model: hr.job}: |
21     self.job_recruitement(cr, uid, [ref('job_developer')])
22 -
23   I check 'state' and number of 'Expected in Recruitment' after initiating the recruitment
24 -
25   !assert {model: hr.job, id: job_developer, string: Job position is in 'recruit' state and no_of_recruitment = 1.0}:
26     - state == 'recruit'
27     - no_of_recruitment == 1.0
28 -
29   I assign the job position to a newly hired employee
30 -
31   !python {model: hr.employee}: |
32     self.write(cr, uid, [ref('employee_niv')], {'job_id':ref('job_developer')})
33 -
34   Now I dont want to recruit new employee for this position. so I mark it as Open.
35 -
36   !python {model: hr.job}: |
37     self.job_open(cr, uid, [ref('job_developer')])
38 -
39   I check 'state' and number of 'Expected in Recruitment' after closing the Job position.
40 -
41   !assert {model: hr.job, id: job_developer, string: Job position is in 'open' state and no_of_recruitment = 0}:
42     - state == 'open'
43     - no_of_recruitment == 0