[IMP] crm_claim: clean test cases
bzr revid: hmo@tinyerp.com-20111025082849-caz28c9qwcqlq2is
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
action = self.onchange_partner_address_id(cr, uid, ref("crm_case_qrecorp0"), ref("base.res_partner_address_notsotinysarl0"), email=False)
|
||||
assert action['value']['country_id'] == 20, "Country name not True"
|
||||
assert action['value']['phone'] == '(+32).81.81.37.00', "phone number is wrong"
|
||||
-
|
||||
I call onchange event to change email "Opt-out" option for Lead.
|
||||
|
||||
@@ -49,7 +49,7 @@ automatically new claims based on incoming emails.
|
||||
'crm_claim_demo.xml',
|
||||
],
|
||||
'test': ['test/process/claim.yml',
|
||||
'test/ui/claim_form.yml'],
|
||||
'test/ui/onchange_events.yml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate' : '00612027414703404749',
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Message-ID: <4EA66F25.7080001@customer.com>
|
||||
Date: Tue, 25 Oct 2011 13:41:17 +0530
|
||||
From: Mr. John Right <info@customer.com>
|
||||
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8
|
||||
MIME-Version: 1.0
|
||||
To: sales@my.com
|
||||
Subject: demande de =?ISO-8859-1?Q?r=E8glement_de_votre_produit=2E?=
|
||||
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
J'ai acheté votre produit il ya quelques jours. maintenant certains
|
||||
problèmes sont survenus sur votre produit.
|
||||
je demande donc à convertir cette demande que la réclamation et de
|
||||
résoudre les problèmes le plus tôt possible.
|
||||
|
||||
Merci
|
||||
|
||||
@@ -1,18 +1,48 @@
|
||||
-
|
||||
I check claim which contain customer claim information about
|
||||
product related problem.
|
||||
Customer claim after sale our product. so He send claim request by email.
|
||||
-
|
||||
I make this claim as Open.
|
||||
Mail script will be fetched him request from mail server. so I process that mail after read EML file
|
||||
-
|
||||
!python {model: mail.thread}: |
|
||||
import addons
|
||||
request_file = open(addons.get_module_resource('crm_claim','test', 'customer_claim.eml'),'rb')
|
||||
request_message = request_file.read()
|
||||
self.message_process(cr, uid, 'crm.claim', request_message)
|
||||
|
||||
-
|
||||
After getting the mail, I check details of new claim of that customer.
|
||||
-
|
||||
!python {model: crm.claim}: |
|
||||
self.case_open(cr, uid, [ref('crm_case_claim04')])
|
||||
claim = self.browse(cr, uid, ref('crm_case_claim04'))
|
||||
from openerp import tools
|
||||
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
|
||||
assert claim_ids and len(claim_ids), "Claim is not created after getting request"
|
||||
claim = self.browse(cr, uid, claim_ids[0], context=context)
|
||||
assert claim.name == tools.ustr("demande derèglement de votre produit."), "Subject does not match"
|
||||
|
||||
-
|
||||
I open customer claim.
|
||||
-
|
||||
!python {model: crm.claim}: |
|
||||
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
|
||||
self.case_open(cr, uid, claim_ids)
|
||||
-
|
||||
I check Claim Details after open.
|
||||
-
|
||||
!python {model: crm.claim}: |
|
||||
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
|
||||
claim = self.browse(cr, uid, claim_ids[0])
|
||||
assert claim.state == "open", "Claim is not in Open state"
|
||||
assert claim.stage_id.id == ref("crm.stage_lead1"), "Claim is not in New stage"
|
||||
-
|
||||
After complete all service from our side i close this claim.
|
||||
After complete all service from our side, I close this claim.
|
||||
-
|
||||
!python {model: crm.claim}: |
|
||||
self.case_close(cr, uid, [ref('crm_case_claim04')])
|
||||
claim = self.browse(cr, uid, ref('crm_case_claim04'))
|
||||
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
|
||||
self.case_close(cr, uid, claim_ids)
|
||||
-
|
||||
I check Claim details after closed
|
||||
-
|
||||
!python {model: crm.claim}: |
|
||||
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
|
||||
claim = self.browse(cr, uid, claim_ids[0])
|
||||
assert claim.state == "done", "Claim is not in close state"
|
||||
|
||||
+8
-2
@@ -1,8 +1,14 @@
|
||||
-
|
||||
In order to test for changes on partner, data change automatically according to partner.
|
||||
I call onchange_event to change partner on claim form.
|
||||
-
|
||||
!python {model: crm.claim}: |
|
||||
partner_onchange = self.onchange_partner_id(cr, uid, [ref('crm_case_claim04')], ref('base.res_partner_10'))
|
||||
assert partner_onchange['value']['partner_phone'] == "+33-658-256545" ,"Phone number is wrong"
|
||||
assert partner_onchange['value']['partner_address_id'] == 20 ,"Address is wrong"
|
||||
assert partner_onchange['value']['email_from'] == 'l.dupont@tecsas.fr' ,"Email address is wrong"
|
||||
|
||||
-
|
||||
I call onchange event to change contact details on claim form.
|
||||
-
|
||||
!python {model: crm.claim}: |
|
||||
self.onchange_partner_address_id(cr, uid, ref('crm_case_claim04'), ref("base.res_partner_address_notsotinysarl0"), email=False)
|
||||
|
||||
Reference in New Issue
Block a user