[ADD]crm_profiling : Add test file for test cases

bzr revid: dbr@tinyerp.com-20110905113218-90qolux3g67t04nm
This commit is contained in:
DBR (OpenERP) 2011-09-05 17:02:18 +05:30
parent 2bc4da7d1c
commit 5fe89be96a
2 changed files with 92 additions and 0 deletions

View File

@ -41,6 +41,7 @@ It also has been merged with the earlier CRM & SRM segmentation tool because the
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'crm_profiling_view.xml'],
'demo_xml': ['crm_profiling_demo.xml'],
'test': ['test/test_crm_profiling.yml'],
'installable': True,
'active': False,
'certificate': '0033984979005',

View File

@ -0,0 +1,91 @@
- |
Now I check segmentation which allows users to perform segmentation within partners.
-
Creating a crm_profiling.question record
-
!record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}:
answers_ids:
- name: 'no'
name: OpenERP partner?
-
Creating a crm_profiling.question record
-
!record {model: crm_profiling.answer, id: crm_profiling_answer_openerppartner0}:
name: 'yes'
question_id: crm_profiling_question_openerppartner0
-
I create Partner category Customers.
-
!record {model: res.partner.category, id: res_partner_category_customers0}:
name: Customers
- |
I'm creating new partner "Mark Johnson" with his email "info@mycustomer.com".
-
!record {model: res.partner, id: res_partner_john0}:
address:
- city: Bruxelles
country_id: base.be
street: Rue des Palais 51, bte 33
type: default
zip: '1000'
email: 'info@mycustomer.com'
name: John
category_id:
- res_partner_category_customers0
answers_ids:
- crm_profiling_answer_openerppartner0
-
Define the answers and category to partner
-
!python {model: res.partner}: |
data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')}
self._questionnaire_compute(cr, uid, data, context)
- |
I start by creating new Questionnaire.
-
!record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}:
description: First questionnaire.
name: Base questionnaire
questions_ids:
- crm_profiling.activity_sector
- crm_profiling.nb_employees
- crm_profiling.partner_level
- |
I create the form
-
!python {model: crm_profiling.questionnaire}: |
context.update({'active_id':ref('res_partner_john0')})
data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')}
self.build_form(cr, uid, data, context)
-
Creating a crm.segmentation record
-
!record {model: crm.segmentation, id: crm_segmentation_test1}:
answer_yes:
- crm_profiling_answer_openerppartner0
categ_id: res_partner_category_customers0
name: test
parent_id: crm_profiling.crm_segmentation0
profiling_active: true
som_interval: 0.0
- |
I continue the process.
-
!python {model: crm.segmentation}: |
#context.update({'active_id':ref('res_partner_john0')})
self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False)