From 0eb7d5f4fa45e7540996b4f28f56725bd99ea8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 22 May 2012 11:51:41 +0200 Subject: [PATCH] [IMP] crm_lead yml tests: removed part about setting a lead into pending; added a re-open oportunity instead. Also updated 'mark lost' part. bzr revid: tde@openerp.com-20120522095141-e0g3qbpduri507nz --- addons/crm/test/process/cancel_lead.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index ca5f7d0174a..41dc62caeba 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -19,15 +19,17 @@ !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in draft state}: - state == "draft" - - I put unqualified lead into pending. + I re-open the opportunity - !python {model: crm.lead}: | - self.case_pending(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + self.case_open(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - I check status of pending lead. + I check stage and state of the re-opened opportunity - - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in pending state}: - - state == "pending" + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm.crm_case_itisatelesalescampaign0')) + assert lead.stage_id.id == ref('crm.stage_lead2'), "Opportunity should be 'New'." + assert lead.state == 'open', "Opportunity should be in 'open' state." - I escalate the lead to parent team. - @@ -48,6 +50,6 @@ - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_case_itisatelesalescampaign0')) - assert lead.state == 'done', "lead is not done state" - assert lead.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!' - assert lead.probability == 0.0, 'Probability is wrong!' + assert lead.stage_id.id == ref('crm.stage_lead6'), "Stage should be 'Lost'." + assert lead.state == 'done', "Opportunity is not in 'done' state." + assert lead.probability == 0.0, 'Opportunity probability is wrong and should be 0.0.'