From 5030f3e6d17125b35e6be7928930fb0f0bc0ed42 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 12 Dec 2011 11:52:25 +0530 Subject: [PATCH 1/3] [IMP] solved the error in yml test case bzr revid: tpa@tinyerp.com-20111212062225-pjqkhlz7nbg1k09h --- addons/marketing_campaign/marketing_campaign_demo.xml | 4 ++-- addons/marketing_campaign/test/marketing_campaign.yml | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/addons/marketing_campaign/marketing_campaign_demo.xml b/addons/marketing_campaign/marketing_campaign_demo.xml index df01161182e..aaf5a98c6bc 100644 --- a/addons/marketing_campaign/marketing_campaign_demo.xml +++ b/addons/marketing_campaign/marketing_campaign_demo.xml @@ -63,7 +63,7 @@ - + @@ -78,7 +78,7 @@ Partners - [('name','like','agrolait')] + [('name','like','Agrolait')] res.partner diff --git a/addons/marketing_campaign/test/marketing_campaign.yml b/addons/marketing_campaign/test/marketing_campaign.yml index 18b3d95a911..562e2f981e0 100644 --- a/addons/marketing_campaign/test/marketing_campaign.yml +++ b/addons/marketing_campaign/test/marketing_campaign.yml @@ -7,11 +7,6 @@ - !assert {model: marketing.campaign, id: marketing_campaign_openerppartnerchannel}: - state == 'running' -- - I assign segment to campaign. -- - !record {model: marketing.campaign.segment, id: marketing_campaign_segment0}: - campaign_id: marketing_campaign_openerppartnerchannel - I start this segment after assinged campaign. - From c922cd895f81ee396be35424ebe247db2f2e025d Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 12 Dec 2011 12:44:29 +0530 Subject: [PATCH 2/3] [FIX] marketing_campaign: Resolved conflicts. bzr revid: uco@tinyerp.com-20111212071429-42kl7qrteufbkyna --- .../marketing_campaign_demo.xml | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml b/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml index 26ea71f1618..7b45c959035 100644 --- a/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml +++ b/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml @@ -39,10 +39,6 @@ -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Hello,Thanks for generous interest you have shown in the openERP.Regards,OpenERP Team, For OpenERP OnDemand Free Trial 2010 @@ -52,10 +48,6 @@ -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Hello,We have very good offer that might suit you. We propose you to subscribe to the OpenERP Discovery Day on May 2010. If any further information required kindly revert back. @@ -64,20 +56,12 @@ For OpenERP Discovery Day on May 2010 -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Thanks for subscribing to the OpenERP Discovery Day info@tinyerp.com -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Hello,Thanks for showing intrest and for subscribing to the OpenERP Discovery Day. If any further information required kindly revert back. I really appreciate your co-operation on this. @@ -85,20 +69,12 @@ For OpenERP Discovery Day -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Thanks for buying the OpenERP book info@tinyerp.com -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Hello,Thanks for showing intrest and buying the OpenERP book. If any further information required kindly revert back. I really appreciate your co-operation on this. @@ -112,10 +88,6 @@ -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Hello, We have very good offer that might suit you. For our gold partners,We are arranging free technical training on june,2010. If any further information required kindly revert back. @@ -130,10 +102,6 @@ -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Hello, We have very good offer that might suit you. For our silver partners,We are paid technical training on june,2010. If any further information required kindly revert back. @@ -148,10 +116,6 @@ -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Hello, We have very good offer that might suit you. For our silver partners,We are offering Gold partnership. If any further information required kindly revert back. @@ -166,10 +130,6 @@ -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE Hello, Thanks for showing intrest and for subscribing to technical training.If any further information required kindly revert back.I really appreciate your co-operation on this. Regards,OpenERP Team, For subscribing to technical training From f9524f5dba526a802a050844df939f0967f5e806 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Tue, 13 Dec 2011 10:52:38 +0530 Subject: [PATCH 3/3] [IMP] improvement in YML test cases in marketing_campaign module bzr revid: tpa@tinyerp.com-20111213052238-kuk13vidnoa3fwhq --- .../marketing_campaign/marketing_campaign.py | 5 +- .../test/marketing_campaign.yml | 50 +++++++++++++++++-- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index 2ec05d17d9b..4e6f6a5227e 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -164,11 +164,12 @@ Normal - the campaign runs normally and automatically sends all emails and repor self.write(cr, uid, ids, {'state': 'cancelled'}) return True - + # dead code def signal(self, cr, uid, model, res_id, signal, run_existing=True, context=None): record = self.pool.get(model).browse(cr, uid, res_id, context) return self._signal(cr, uid, record, signal, run_existing, context) + #dead code def _signal(self, cr, uid, record, signal, run_existing=True, context=None): if not signal: raise ValueError('signal cannot be False') @@ -461,6 +462,7 @@ class marketing_campaign_activity(osv.osv): return super(marketing_campaign_activity, self).search(cr, uid, args, offset, limit, order, context, count) + #dead code def _process_wi_report(self, cr, uid, activity, workitem, context=None): service = netsvc.LocalService('report.%s'%activity.report_id.report_name) (report_data, format) = service.create(cr, uid, [], {}, {}) @@ -481,6 +483,7 @@ class marketing_campaign_activity(osv.osv): activity.email_template_id.id, workitem.res_id, context=context) + #dead code def _process_wi_action(self, cr, uid, activity, workitem, context=None): if context is None: context = {} diff --git a/addons/marketing_campaign/test/marketing_campaign.yml b/addons/marketing_campaign/test/marketing_campaign.yml index 562e2f981e0..1b7a7fa2ae3 100644 --- a/addons/marketing_campaign/test/marketing_campaign.yml +++ b/addons/marketing_campaign/test/marketing_campaign.yml @@ -20,7 +20,27 @@ I synchronized segment manually to see all step of activity and process covered on this campaign. - !python {model: marketing.campaign.segment}: | + segment_id = self.browse(cr ,uid ,ref("marketing_campaign_segment0") ,context) + assert segment_id.date_next_sync, 'Next Synchronization date is not calculated.' self.synchroniz(cr, uid, [ref("marketing_campaign_segment0")]) +- + I cancel Marketing Workitems. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel'))]) + self.button_cancel(cr, uid, ids) + record = self.browse(cr, uid, ids[0]) + assert record.state == 'cancelled' or record.state == 'done' , 'Marketing Workitem shoud be in cancel state.' +- + I set Marketing Workitems in draft state. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel'))]) + self.button_draft(cr, uid, ids) + record = self.browse(cr, uid, ids[0]) + assert record.state == 'todo' or record.state == 'done' , 'Marketing Workitem shoud be in draft state.' - I check followup detail of first activity. - @@ -28,7 +48,9 @@ ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_0'))]) assert ids, 'Followup item is not created for first activity.' -- + work_item_id = self.browse(cr ,uid ,ids[0] ,context) + assert work_item_id.res_name, 'Resource Name is not defined.' +- I process followup of first activity. - !python {model: marketing.campaign.workitem}: | @@ -49,7 +71,7 @@ - !python {model: res.partner}: | self.write(cr, uid, [ref("base.res_partner_agrolait")], {'credit_limit':41000}, context=context) -- +- I process followup of second activity after set draft. - !python {model: marketing.campaign.workitem}: | @@ -71,7 +93,7 @@ - !python {model: res.partner}: | self.write(cr, uid, [ref("base.res_partner_agrolait")], {'credit_limit':151000}, context=context) -- +- I process followup of third activity after set draft. - !python {model: marketing.campaign.workitem}: | @@ -89,7 +111,27 @@ ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_2'))]) self.preview(cr, uid, ids) - - I close segmentation After completion of all activity. + I cancel segmentation because of some activity. +- + !workflow {model: marketing.campaign.segment, action: state_cancel_set, ref: marketing_campaign_segment0} +- + I check the segmentation is canceled. +- + !assert {model: marketing.campaign.segment, id: marketing_campaign_segment0}: + - state == 'cancelled' +- + I reopen the segmentation. +- + !workflow {model: marketing.campaign.segment, action: state_draft_set, ref: marketing_campaign_segment0} +- + !workflow {model: marketing.campaign.segment, action: state_running_set, ref: marketing_campaign_segment0} +- + I check the segment on Running mode after started. +- + !assert {model: marketing.campaign.segment, id: marketing_campaign_segment0}: + - state == 'running' +- + I close segmentation After completion of all activity. - !workflow {model: marketing.campaign.segment, action: state_done_set, ref: marketing_campaign_segment0} -