From 376d264fcbae95790c0b6c149bbdbeaa6514f352 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Thu, 17 Nov 2011 14:01:43 +0530 Subject: [PATCH] [IMP] hr: improve test case of job process bzr revid: jap@tinyerp.com-20111117083143-rjsfxp8ayx78nryr --- addons/hr/__openerp__.py | 2 +- addons/hr/test/hr_employee_demo.yml | 46 +++---------------- .../{process => }/open2recruit2close_job.yml | 16 +++---- 3 files changed, 15 insertions(+), 49 deletions(-) rename addons/hr/test/{process => }/open2recruit2close_job.yml (70%) diff --git a/addons/hr/__openerp__.py b/addons/hr/__openerp__.py index b78e9c03916..c1a75cbb7f5 100644 --- a/addons/hr/__openerp__.py +++ b/addons/hr/__openerp__.py @@ -56,7 +56,7 @@ You can manage: ], 'test': [ 'test/hr_employee_demo.yml', - 'test/process/open2recruit2close_job.yml', + 'test/open2recruit2close_job.yml', ], 'installable': True, 'active': False, diff --git a/addons/hr/test/hr_employee_demo.yml b/addons/hr/test/hr_employee_demo.yml index 31cf58c2788..846747e9a25 100644 --- a/addons/hr/test/hr_employee_demo.yml +++ b/addons/hr/test/hr_employee_demo.yml @@ -1,10 +1,10 @@ - - !record {model: hr.department, id: hr_department_rd0}: + !record {model: hr.department, id: dep_technical, view: False}: manager_id: base.user_root name: 'R & D' - - !record {model: hr.job, id: hr_job_jea0}: - department_id: 'hr_department_rd0' + !record {model: hr.job, id: job_jr_appli, view: False}: + department_id: 'dep_technical' description: 'Position of Junior Application Engineer' expected_employees: 5.0 name: 'JAE' @@ -12,44 +12,10 @@ 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}: + !record {model: hr.employee, id: employee1, view: False}: address_id: base.main_address company_id: base.main_company - department_id: hr_department_rd0 + department_id: dep_technical 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 -- - - - - - - - + user_id: base.user_demo \ No newline at end of file diff --git a/addons/hr/test/process/open2recruit2close_job.yml b/addons/hr/test/open2recruit2close_job.yml similarity index 70% rename from addons/hr/test/process/open2recruit2close_job.yml rename to addons/hr/test/open2recruit2close_job.yml index aedd2a3d2a1..597db098a29 100644 --- a/addons/hr/test/process/open2recruit2close_job.yml +++ b/addons/hr/test/open2recruit2close_job.yml @@ -4,36 +4,36 @@ I open Job Postion of "Jr. Application Engineer" Profile. - !python {model: hr.job}: | - self.job_open(cr, uid, [ref('hr_job_jea0')]) + self.job_open(cr, uid, [ref('job_jr_appli')]) - I check state of Job Position after opened it. - - !assert {model: hr.job, id: hr_job_jea0}: + !assert {model: hr.job, id: job_jr_appli}: - state == 'open' - 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')]) + self.job_recruitement(cr, uid, [ref('job_jr_appli')]) - 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}: + !assert {model: hr.job, id: job_jr_appli}: - 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')}) + self.write(cr, uid, [ref('employee1')], {'job_id':ref('job_jr_appli')}) - 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')]) + self.job_old(cr, uid, [ref('job_jr_appli')]) - I check state of Job position and number of Expected in Recruitment after closed Job position. - - !assert {model: hr.job, id: hr_job_jea0}: + !assert {model: hr.job, id: job_jr_appli}: - state == 'old' - - no_of_recruitment == 0 + - no_of_recruitment == 0 \ No newline at end of file