[ADD]: test case fot stage find
bzr revid: aja@tinyerp.com-20130626065433-9lwslnil10k3w8wv
This commit is contained in:
@@ -109,6 +109,7 @@ Dashboard for CRM will include:
|
||||
'test/crm_lead_message.yml',
|
||||
'test/lead2opportunity2win.yml',
|
||||
'test/lead2opportunity_assign_salesmen.yml',
|
||||
'test/crm_lead_find_stage.yml',
|
||||
'test/crm_lead_merge.yml',
|
||||
'test/crm_lead_cancel.yml',
|
||||
'test/segmentation.yml',
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
-
|
||||
I create a new lead.
|
||||
-
|
||||
!record {model: crm.lead, id: test_crm_lead_new}:
|
||||
type: 'lead'
|
||||
name: 'Test lead new'
|
||||
partner_id: base.res_partner_1
|
||||
description: This is the description of the test new lead.
|
||||
section_id: crm.section_sales_department
|
||||
-
|
||||
I check default stage of lead.
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
stage = self.pool.get('crm.case.stage').search_read(cr,uid,[('sequence','=',1)],['id'],context)[0]
|
||||
lead = self.browse(cr, uid, ref('test_crm_lead_new'))
|
||||
stage_id = self.stage_find(cr, uid , [lead], lead.section_id.id or False,[], context)
|
||||
assert stage_id == stage['id'], "Default stage of lead is incorrect!"
|
||||
-
|
||||
I change type from lead to opportunity.
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
self.convert_opportunity(cr, uid ,[ref("test_crm_lead_new")], ref("base.res_partner_2"))
|
||||
-
|
||||
Now I check default stage after change type.
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
stage = self.pool.get('crm.case.stage').search_read(cr,uid,[('sequence','=',1)],['id'],context)[0]
|
||||
opp = self.browse(cr, uid, ref('test_crm_lead_new'))
|
||||
stage_id = self.stage_find(cr, uid , [opp], opp.section_id.id or False,[], context)
|
||||
assert stage_id == stage['id'], "Default stage of opportunity is incorrect!"
|
||||
-
|
||||
Now I change the stage of opportunity to won.
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
self.case_mark_won(cr, uid, [ref("test_crm_lead_new")])
|
||||
-
|
||||
I check statge of opp should won, after change stage.
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
opp = self.browse(cr, uid, ref('test_crm_lead_new'))
|
||||
stage_id = self.stage_find(cr, uid , [opp], opp.section_id.id or False,[('probability','=',100.0)], context)
|
||||
assert stage_id == opp.stage_id.id, "Stage of opportunity is incorrect!"
|
||||
|
||||
Reference in New Issue
Block a user