From 3cba14171c02bdf818ce2b02be2049dbd509fe0e Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Mon, 28 Nov 2011 11:52:47 +0530 Subject: [PATCH] [IMP] hr_recruitment: improve yml test process to check attachment in email after getting bzr revid: hmo@tinyerp.com-20111128062247-ztxmc9zdrdzy57yp --- addons/hr_recruitment/test/recruitment_process.yml | 8 +++++--- addons/hr_recruitment/test/resume.eml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 64e8ab687a8..33232ab0f2f 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -15,8 +15,10 @@ applicant_ids = self.search(cr, uid, [('email_from','=', 'Mr. Richard Anderson ')]) assert applicant_ids, "Applicant is not created after getting the mail" applicant = self.browse(cr, uid, applicant_ids[0], context=context) - assert applicant.name == "Application for the post of Jr.application Programmer", "Subject does not match" + resume_ids = self.pool.get('ir.attachment').search(cr, uid, [('datas_fname','=','resume.doc'),('res_model','=',self._name),('res_id','=',applicant.id)]) + assert applicant.name == "Application for the post of Jr.application Programmer.", "Subject does not match" assert applicant.state == "draft" + assert len(resume_ids), "Resume does not attached." - I assign the Job position to the applicant - @@ -54,7 +56,7 @@ !python {model: hr.applicant}: | self.action_print_survey(cr, uid, [ref('hr_case_programmer')]) - - On a successful meeting with the applicant, I hired employee. + On a successful interview with the applicant, I hired employee. - !python {model: hr.applicant}: | self.case_close(cr, uid, [ref('hr_case_programmer')]) @@ -62,4 +64,4 @@ I check that applicant is "Hired". - !assert {model: hr.applicant, id: hr_case_programmer}: - - state == 'done' \ No newline at end of file + - state == 'done' diff --git a/addons/hr_recruitment/test/resume.eml b/addons/hr_recruitment/test/resume.eml index 9529873a49c..00cc5620563 100644 --- a/addons/hr_recruitment/test/resume.eml +++ b/addons/hr_recruitment/test/resume.eml @@ -24,11 +24,11 @@ X-YMail-OSG: 09Al2uQVM1n5JcQepgua6wQsww7jiatAHXaSsMjP5Qvk9Ba LLM1_BE.EOvXdW38ZC_hHcrM4xYaYSR7c0WaOQsR8EZeXk_Vhio7HHUrdxZl 1oZz7YWK9Q04M023JJoM4v6IrThy3BNepluEFFcavkyOnCw-- X-Yahoo-SMTP: oNtzSBqswBAqJIGYOgyGesyleENrhUEtEgBkQ053 -Received: from [192.168.1.30] (jagdish.n_panchal@180.211.100.2 with plain) +Received: from [192.168.1.30] (test@180.211.100.2 with plain) by smtp205.mail.ne1.yahoo.com with SMTP; 18 Nov 2011 01:26:47 -0800 PST Message-ID: <4EC624C7.6020000@yahoo.in> Date: Fri, 18 Nov 2011 14:56:31 +0530 -From: Richard Anderson +From: Mr. Richard Anderson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: hr@mycompany.com