[IMP] hr: Improved yaml. Added tests for some onchange methods.
[odoo/odoo.git] / addons / hr / test / test_hr.yml
1 -
2   In order to test hr module in OpenERP, I will create new Employee , Department and Job Position.
3 -
4   I create "R&D Department" in Department form.
5 -
6   !record {model: hr.department, id: hr_department_rd0}:
7     manager_id: base.user_root
8     name: 'R & D'
9 -
10   Now, I create a new employee “Mark Johnson”, and select department as "R&D Department".
11 -
12   !record {model: hr.employee, id: hr_employee_mark}:
13     address_home_id: base.res_partner_address_1
14     company_id: base.main_company
15     gender: male
16     marital: 'single'
17     name: Mark Johnson
18     user_id: base.user_root
19 -
20   I assign department for employee 'Mark Johnson'
21 -
22   !python {model: hr.employee}: |
23     res = self.onchange_department_id(cr, uid, ref('hr_employee_mark'), ref('hr_department_rd0'), None)
24     assert res['value']['parent_id']
25 -
26   In order to check the wizard “Employee Hierarchy” , I will create new employee “Phil Graves ” and select "Mark Johnson" as
27   Manager.
28 -
29   !record {model: hr.employee, id: hr_employee_phil}:
30     address_home_id: base.res_partner_address_3000
31     company_id: base.main_company
32     gender: male
33     name: Phil Graves
34     user_id: base.user_demo
35     parent_id: 'hr_employee_mark'
36 -
37   I fill the Working address for Employee
38 -
39   !python {model: hr.employee}: |
40     res = self.onchange_address_id(cr, uid, ref('hr_employee_phil'), ref('base.res_partner_address_3000'), None)
41     assert res['value']
42 -
43   I will open up form view of  “Mark Johnson” and test the wizard “Employee Hierarchy” so it display the employee
44   hierarchy starting from “Mark Johnson”.
45
46 -
47   I will create new Job Position. I will check successfull creation of new Job Position by adding the information.
48 -
49   !record {model: hr.job, id: hr_job_jea0}:
50     department_id: 'hr_department_rd0'
51     description: 'Position of Junior Application Engineer'
52     expected_employees: 5
53     name: 'JAE'
54 -
55   I check that Employee form is in "Open" state.
56 -
57   !assert {model: hr.job, id: hr_job_jea0}:
58     - state == 'open'
59
60 -
61   I create Employee for job position.
62 -
63   !record {model: hr.job, id: hr_job_jea0}:
64     employee_ids:
65       - address_home_id: base.res_partner_address_1
66         name: Manuel Lehba
67         department_id: 'hr_department_rd0'
68         gender: male
69         parent_id: 'hr_employee_mark'
70 -
71   I check that "Number of Employees" field have some value.
72 -
73   !assert {model: hr.job, id: hr_job_jea0}:
74     - no_of_employee != False