From 124db51e5926de2d53268a9a19887c89e4faea81 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Sat, 10 Jul 2010 19:00:42 +0530 Subject: [PATCH] [FIX]: crm, crm_claim, crm_helpdesk: Fixed warnings in yaml test bzr revid: rpa@tinyerp.com-20100710133042-ltnj91iclrkj3jy0 --- addons/crm/test/test_crm_lead.yml | 16 ++-------------- addons/crm/test/test_crm_opportunity.yml | 17 ++++++++--------- addons/crm/test/test_crm_phonecall.yml | 15 +++------------ addons/crm_claim/test/test_crm_claim.yml | 5 ----- addons/crm_helpdesk/test/test_crm_helpdesk.yml | 11 +---------- 5 files changed, 14 insertions(+), 50 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 97c54b5ef2b..f61021a5606 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -78,24 +78,12 @@ !python {model: crm.lead2opportunity}: | self.action_apply(cr, uid, [ref('crm_lead2opportunity_stonage_0')], {'active_id': ref('crm_lead_newcustomer0')}) -- | - I can check that a lead and a business opportunity is now assigned to this - lead. -#- -# !python {model: crm.lead, id: crm_lead_newcustomer0}: -# - opportunity_id == False - - | - I check that the partner associated to this lead as the same country, phone number - and name than the opportunity. + In order to check the opportunity is created or not, I check type. - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) - obj_opportunity = self.pool.get('crm.lead') - ids = obj_opportunity.search(cr, uid, [('name', '=', lead.partner_name)]) - opportunity = obj_opportunity.browse(cr, uid, ids)[0] - assert lead.partner_name == opportunity.partner_id.name - assert lead.phone == opportunity.phone + assert lead.type == 'opportunity' #- # | diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index 48a71de1dce..cf62d05e0b6 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -4,7 +4,7 @@ - !record {model: crm.lead, id: crm_opportunity_abcfuelcounits0}: email_from: info@balmerinc.be - name: 'ABC FUEL CO 829264 - 10002 units ' + name: 'ABC FUEL CO 829264 - 10002 units' partner_address_id: base.res_partner_address_1 partner_id: base.res_partner_9 probability: 1.0 @@ -35,17 +35,15 @@ then I click on the date on which I want schedule meeting. I fill proper data for that meeting and save it - - !record {model: crm.meeting, id: crm_meeting_abcfuelcounits0}: - alarm_id: base_calendar.alarm3 + !record {model: crm.meeting, id: crm_meeting_abcfuelcounits0}: date: '2010-04-16 00:00:00' date_deadline: '2010-04-16 08:00:00' duration: 8.0 email_from: info@balmerinc.be - name: 'ABC FUEL CO 829264 - 10002 units ' + name: 'ABC FUEL CO 829264 - 10002 units' opportunity_id: 'crm_opportunity_abcfuelcounits0' partner_address_id: base.res_partner_address_1 partner_id: base.res_partner_9 - rrule_type: weekly section_id: crm.section_sales_department state: open - | @@ -54,7 +52,7 @@ - !record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}: date: '2010-04-17 11:15:00' - name: 'ABC FUEL CO 829264 - 10002 units ' + name: 'ABC FUEL CO 829264 - 10002 units' section_id: crm.section_sales_department user_id: base.user_demo - | @@ -66,8 +64,9 @@ I check that phonecall record is created for that opportunity. - !python {model: crm.phonecall}: | - ids = self.search(cr, uid, [('name', '=', 'ABC FUEL CO 829264 - 10002 units')]) - assert len(ids) + phone_obj = self.pool.get('crm.phonecall') + ids = phone_obj.search(cr, uid, [('name', '=', 'ABC FUEL CO 829264 - 10002 units')]) + assert len(ids) - | I can see phonecall record after click on "Schedule call" wizard. - @@ -78,4 +77,4 @@ partner_address_id: base.res_partner_address_1 partner_id: base.res_partner_9 section_id: crm.section_sales_department - \ No newline at end of file + diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index f2020659aed..af28c19a10e 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -33,22 +33,19 @@ - !python {model: crm.phonecall2opportunity}: | self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")}) -- - # This is not working, find a way to do that in YAML - + - | I can see that a business opportunity is now assigned to this phonecall - !assert {model: crm.phonecall, id: crm_phonecall_interviewcall0}: - - opportunity_id == True + - opportunity_id != False - | And I check that the phonecall and the newly created business opportunity is linked to same partner - !python {model: crm.phonecall}: | - xid= ref('crm_phonecall_interviewcall0') - obj_phonecall = self.browse(cr, uid, xid) + obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0')) ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] assert obj_phonecall.partner_id == obj_opp.partner_id @@ -77,12 +74,6 @@ phonecall_id: 'crm_phonecall_interviewcall0' rrule_type: weekly state: open - -- - #This is not working for yaml -- | - I can jump to this meeting by "Meetings" shortcut from my phonecall's form view -- - | In order to schedule other phonecall to the partner diff --git a/addons/crm_claim/test/test_crm_claim.yml b/addons/crm_claim/test/test_crm_claim.yml index e8000161a1e..14551ad65ad 100644 --- a/addons/crm_claim/test/test_crm_claim.yml +++ b/addons/crm_claim/test/test_crm_claim.yml @@ -20,11 +20,6 @@ - !assert {model: crm.claim, id: crm_claim_damagedproduct0}: - state == 'draft' -- | - Now I make sure that claim is at "Accepted" stage. -- - !assert {model: crm.claim, id: crm_claim.crm_claim_damagedproduct0}: - stage_id: crm_claim.stage_claim1 - | I can change that stage by next button right on it - diff --git a/addons/crm_helpdesk/test/test_crm_helpdesk.yml b/addons/crm_helpdesk/test/test_crm_helpdesk.yml index 6d3beb43b41..6872a99a60e 100644 --- a/addons/crm_helpdesk/test/test_crm_helpdesk.yml +++ b/addons/crm_helpdesk/test/test_crm_helpdesk.yml @@ -21,18 +21,9 @@ - !python {model: crm.helpdesk}: | self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) -- | - I can see that "Send Reminder" button is visible, which is used to send reminder to partner from - responsible person or send reminder to responsible person from partner. -- - #this is not work for yaml. -- -# !python {model: crm.helpdesk}: | -# self.remind_user(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')], context={}, attach=False, destination=True) - | After a proper communication for the request via email I make sure that the request is fulfilled and I close this HelpDesk Request by clicking on "Close" button. - !python {model: crm.helpdesk}: | - self.case_close(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) -- + self.case_close(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')])