summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2011-12-15 11:15:35 +0100
committerRaphael Collet <rco@openerp.com>2011-12-15 11:15:35 +0100
commit88dfee7df4bb2a392fa97635a6e817e44c8277c6 (patch)
tree45e4d5a48ced43b83f21bb661926990124a6fa19 /addons
parenta44dd489d0c8e542af095dd1feb133a397ff5bbc (diff)
parent337fd9d81e42615711facfaeda9001ee52446ba1 (diff)
[MERGE] hr_recruitment: improve test code coverage
bzr revid: rco@openerp.com-20111215101535-6p0m6v9s04z5msfz
Diffstat (limited to 'addons')
-rw-r--r--addons/hr_recruitment/hr_recruitment.py4
-rw-r--r--addons/hr_recruitment/test/recruitment_process.yml65
2 files changed, 59 insertions, 10 deletions
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 2854ddf95a5..c07ec8188b8 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -184,10 +184,6 @@ class hr_applicant(crm.crm_case, osv.osv):
'user_email': fields.related('user_id', 'user_email', type='char', string='User Email', readonly=True),
}
- def _get_stage(self, cr, uid, context=None):
- ids = self.pool.get('hr.recruitment.stage').search(cr, uid, [], context=context)
- return ids and ids[0] or False
-
_defaults = {
'active': lambda *a: 1,
'user_id': lambda self, cr, uid, context: uid,
diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml
index 43575137a6e..c1ef5022209 100644
--- a/addons/hr_recruitment/test/recruitment_process.yml
+++ b/addons/hr_recruitment/test/recruitment_process.yml
@@ -20,27 +20,49 @@
assert applicant.state == "draft"
assert len(resume_ids), "Resume does not attached."
-
- I assign the Job position to the applicant
+ I refuse applicant for the Recruitment.
-
!python {model: hr.applicant}: |
- self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')})
+ self.case_close(cr, uid, [ref("hr_case_programmer")])
-
- I open applicant for the Recruitment
+ I open applicant for the Recruitment.
-
-
!python {model: hr.applicant}: |
+ self.case_reset(cr, uid, [ref("hr_case_programmer")])
self.case_open(cr, uid, [ref("hr_case_programmer")])
-
+ I assign the Job position to the applicant
+-
+ !python {model: hr.applicant}: |
+ self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')})
+-
I start communication with applicant, first schedule phonecall.
-
!python {model: hr.recruitment.job2phonecall}: |
- self.make_phonecall(cr, uid, [ref('hr_case_programmer')])
+ context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")})
+ id = self.create(cr, uid, {}, context=context)
+ self.make_phonecall(cr, uid, [id], context=context)
-
I schedule meeting with applicant for interview.
-
!python {model: hr.applicant}: |
self.action_makeMeeting(cr, uid, [ref('hr_case_programmer')])
-
+ I check Initial Qualification of applicant.
+-
+ !python {model: hr.applicant}: |
+ self.stage_next(cr, uid, [ref('hr_case_programmer')])
+-
+ I schedule First Interview of applicant.
+-
+ !python {model: hr.applicant}: |
+ self.stage_next(cr, uid, [ref('hr_case_programmer')])
+-
+ On a successful First Interview of applicant, I schedule Second Interview.
+-
+ !python {model: hr.applicant}: |
+ self.stage_next(cr, uid, [ref('hr_case_programmer')])
+-
Applicant fillup the answer of the interview quetion.
-
!python {model: survey.question.wiz}: |
@@ -56,7 +78,13 @@
!python {model: hr.applicant}: |
self.action_print_survey(cr, uid, [ref('hr_case_programmer')])
-
- On a successful interview with the applicant, I hired employee.
+ On a successful Second Interview of applicant Contract is Proposed to applicant.
+-
+ !python {model: hr.applicant}: |
+ self.stage_next(cr, uid, [ref('hr_case_programmer')])
+ self.stage_previous(cr, uid, [ref('hr_case_programmer')])
+-
+ I Hired Applicant.
-
!python {model: hr.applicant}: |
self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')])
@@ -65,3 +93,28 @@
-
!assert {model: hr.applicant, id: hr_case_programmer}:
- state == 'done'
+-
+ I do not give employment to the hired the applicant.
+-
+ !python {model: hired.employee}: |
+ context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
+ emp_id = self.create(cr, uid, {}, context=context)
+ self.case_close(cr, uid, [emp_id], context=context)
+-
+ Now I give employment to hired applicant .
+-
+ !python {model: hr.applicant}: |
+ hired_emp_obj = self.pool.get('hired.employee')
+ self.case_reset(cr, uid, [ref("hr_case_programmer")])
+ self.case_open(cr, uid, [ref("hr_case_programmer")])
+ context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
+ emp_hr_id = hired_emp_obj.create(cr, uid, {}, context=context)
+ hired_emp_obj.case_close_with_emp(cr, uid, [emp_hr_id], context=context)
+-
+ Now hired employee want to be a partner of company.
+-
+ !record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_id1 }:
+-
+ !python {model: hr.recruitment.partner.create}: |
+ context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
+ self.make_order(cr, uid, [ref("hr_recruitment_partner_id1")], context=context)