From 3f26dce9f8ec2fc80adb1b9d424a734318140af1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:06:01 +0530 Subject: [PATCH] [IMP, REF] crm: 1) Renamed lead2opportunity.yml to lead2opportunity_win_lost.yml, 2) Removed code of Merge2opportunity 3)Improved string bzr revid: ron@tinyerp.com-20111017123601-vnyfiekpupjkxgf1 --- addons/crm/__openerp__.py | 2 +- ...nity.yml => lead2opportunity_win_lost.yml} | 32 ++++--------------- 2 files changed, 7 insertions(+), 27 deletions(-) rename addons/crm/test/process/{lead2opportunity.yml => lead2opportunity_win_lost.yml} (68%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index cbcaa774c05..7b11d12cede 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -120,7 +120,7 @@ Creates a dashboard for CRM that includes: ], 'test': [ 'test/process/lead_open.yml', - 'test/process/lead2opportunity.yml', + 'test/process/lead2opportunity_win_lost.yml', 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity_win_lost.yml similarity index 68% rename from addons/crm/test/process/lead2opportunity.yml rename to addons/crm/test/process/lead2opportunity_win_lost.yml index ef8d20fc602..e5103c48ef0 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity_win_lost.yml @@ -1,17 +1,16 @@ - - As the lead seems to be a real business opportunity, I will convert it to a partner - and a business opportunity. + I test to convert lead to real business opportunity, so first i create existing partner attached with lead. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: action: 'exist' partner_id: base.res_partner_agrolait - - Create opportunity based on exiting partner + Create opportunity based on exiting partner. - !python {model: crm.lead2opportunity.partner}: | self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - - In order to test lead, i will test to lead is converted to opportunity. + After converted in opportunity, i test to lead is converted to opportunity. - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) @@ -19,12 +18,12 @@ assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' - - Finally, i won this opportunity, so i will close this lead. + Finally, i won this opportunity, so i close this opportunity. - !python {model: crm.lead}: | self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) - - In order to test opportunity, it is close or not. + I check lead is close or not. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - state == "done" @@ -52,7 +51,7 @@ # lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) # assert lead.message_ids[0].subject == 'I won this Opportunity', 'Fail to Added interal note on opportunity' - - After winning the opportunity, i will test probability is 100. + After winning the opportunity, i test probability is 100. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 @@ -69,22 +68,3 @@ opportunity = self.browse(cr, uid, ref('crm_case_rdroundfundingunits0')) assert opportunity.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!' assert opportunity.probability == 0.0, 'Probability is wrong!' - -- - I have two opportunity ,so i will merge this two Opportunities. -- - !python {model: crm.merge.opportunity}: | - op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) - self.merge(cr, uid, op_ids) - -- - I will test which two opportunity merged . -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) - merge = 'Merged opportunities' in lead.message_ids[0].subject - assert merge,'Fail to create Merge opportunity' - assert lead.type == 'opportunity', 'Merged opportunity type not change!' - assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' - assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' - \ No newline at end of file