Jagdish Panchal (Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-polish2-improve_testcase_yml_hr-jap
into lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-polish2-improve_testcase_yml_hr-jap/+merge/82268
hr: improve test case of process of Job position to open job, to start
requirement and close job position
---------------------
1) hr_employee_demo.yml
create the demo record for the test case.
2) open2recruit2close_job.yml
- Open the job Position,
- Start the recruitment,
- Set the job Position for the new employee,
- And close the job position.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-polish2-improve_testcase_yml_hr-jap/+merge/82268
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-polish2-improve_testcase_yml_hr-jap.
=== modified file 'hr/__openerp__.py'
--- hr/__openerp__.py 2011-10-16 01:28:00 +0000
+++ hr/__openerp__.py 2011-11-15 11:13:14 +0000
@@ -54,7 +54,10 @@
'hr_demo.xml',
'hr_department_demo.xml',
],
- 'test': ['test/test_hr.yml'],
+ 'test': [
+ 'test/hr_employee_demo.yml',
+ 'test/process/open2recruit2close_job.yml',
+ ],
'installable': True,
'active': False,
'certificate': '0086710558965',
=== added file 'hr/test/hr_employee_demo.yml'
--- hr/test/hr_employee_demo.yml 1970-01-01 00:00:00 +0000
+++ hr/test/hr_employee_demo.yml 2011-11-15 11:13:14 +0000
@@ -0,0 +1,55 @@
+-
+ !record {model: hr.department, id: hr_department_rd0}:
+ manager_id: base.user_root
+ name: 'R & D'
+-
+ !record {model: hr.job, id: hr_job_jea0}:
+ department_id: 'hr_department_rd0'
+ description: 'Position of Junior Application Engineer'
+ expected_employees: 5.0
+ name: 'JAE'
+ no_of_employee: 0.0
+ no_of_recruitment: 5.0
+ state: open
+-
+ !record {model: hr.job, id: hr_job_jea0}:
+ employee_ids:
+ - address_home_id: base.res_partner_address_1
+ name: Manuel Lehba
+ department_id: 'hr_department_rd0'
+ gender: male
+ parent_id: hr.employee1
+-
+ !record {model: hr.employee, id: hr_employee001, view: False}:
+ address_id: base.main_address
+ company_id: base.main_company
+ department_id: hr_department_rd0
+ name: smith
+ parent_id: hr.employee1
+ user_id: base.user_demo
+-
+ !record {model: hr.employee, id: hr_employee_edwin0}:
+ address_home_id: base.res_partner_address_3000
+ address_id: base.res_partner_address_rogerpecker0
+ department_id: hr.dep_administration
+ job_id: hr.job_hr_manager
+ name: Edwin
+ parent_id: hr.employee2
+ resource_type: user
+ time_efficiency: 1.0
+ user_id: base.user_demo
+-
+ !record {model: hr.employee.category, id: hr_employee_category_fresher0}:
+ name: Fresher
+-
+ !record {model: hr.employee.category, id: hr_employee_category_juniorlevel0}:
+ name: Junior Level
+ parent_id: hr_employee_category_fresher0
+-
+
+
+
+
+
+
+
=== added directory 'hr/test/process'
=== renamed file 'hr/test/test_hr.yml' => 'hr/test/process/open2recruit2close_job.yml'
--- hr/test/test_hr.yml 2011-11-14 22:31:19 +0000
+++ hr/test/process/open2recruit2close_job.yml 2011-11-15 11:13:14 +0000
@@ -1,4 +1,5 @@
-
+<<<<<<< TREE
In order to test hr module in OpenERP, I will create new Employee, Department and Job Position.
-
I create "RD Department" in Department form.
@@ -80,61 +81,43 @@
name: 'JAE'
-
I check that Employee form is in "Open" state.
+=======
+ In Order to test process of Job Position,
+-
+ I open Job Postion of "Jr. Application Engineer" Profile.
+-
+ !python {model: hr.job}: |
+ self.job_open(cr, uid, [ref('hr_job_jea0')])
+-
+ I check state of Job Position after opened it.
+>>>>>>> MERGE-SOURCE
-
!assert {model: hr.job, id: hr_job_jea0}:
- state == 'open'
-
- I create Employee for job position.
--
- !record {model: hr.job, id: hr_job_jea0}:
- employee_ids:
- - address_home_id: base.res_partner_address_1
- name: Manuel Lehba
- department_id: 'hr_department_rd0'
- gender: male
- parent_id: 'hr_employee_mark'
--
- I check that "Number of Employees" field have some value.
--
- !assert {model: hr.job, id: hr_job_jea0}:
- - no_of_employee != False
--
- As more requirements on the said job position are come, I increase the number of expected employees.
--
- !python {model: hr.job}: |
- res = self.on_change_expected_employee(cr, uid, [ref('hr_job_jea0')], 6, 3, None)
- assert res['value']['expected_employees']
- values = dict([('expected_employees', ref('hr_job_jea0'))] + res['value'].items())
- self.write(cr, uid, [ref('hr_job_jea0')], values, None)
--
- I open the job position for recruitment.
--
+ Now, Recruitement is started so I start recruitement of Job Postion of "Jr. Application Engineer" Profile.
+-
!python {model: hr.job}: |
self.job_recruitement(cr, uid, [ref('hr_job_jea0')])
-
- I assign the job position to employee and mark the position.
--
- !python {model: hr.job}: |
- self.job_open(cr, uid, [ref('hr_job_jea0')])
--
- Now the process is over so I don't want to use this position. I mark it as Old.
+ I check state and number of Expected in Recruitment in Job Position of "Jr. Application Engineer" Profile.
+-
+ !assert {model: hr.job, id: hr_job_jea0}:
+ - state == 'recruit'
+ - no_of_recruitment == 1.0
+-
+ I hired new employee for the job position so I set Job Position of "Jr. Application Engineer" Profile to new employee.
+-
+ !python {model: hr.employee}: |
+ self.write(cr, uid, [ref('hr_employee001')], {'job_id':ref('hr_job_jea0')})
+-
+ Now I don't want to recruit new employee on this position. so I mark it as Old.
-
!python {model: hr.job}: |
self.job_old(cr, uid, [ref('hr_job_jea0')])
-
- I create a parent category for the new recruited employees who are Freshers.
--
- !record {model: hr.employee.category, id: hr_employee_category_fresher0}:
- name: Fresher
--
- I create another category for Junior Level freshers.
--
- !record {model: hr.employee.category, id: hr_employee_category_juniorlevel0}:
- name: Junior Level
- parent_id: hr_employee_category_fresher0
--
- I open the tree view of Categories and see the categories in a hierarchical manner.
--
- !python {model: hr.employee.category}: |
- res = self.name_get(cr, uid, [ref('hr_employee_category_juniorlevel0')], None)
- assert res
+ I check state of Job position and number of Expected in Recruitment after closed Job position.
+-
+ !assert {model: hr.job, id: hr_job_jea0}:
+ - state == 'old'
+ - no_of_recruitment == 0
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp