diff options
| author | Raphael Collet <rco@openerp.com> | 2011-12-13 12:01:20 +0100 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2011-12-13 12:01:20 +0100 |
| commit | 6d2b3545773ce354721a313db74a3ef5b47fa2d9 (patch) | |
| tree | af9df212925ad78cd016429f8a5a1789ba993853 /addons/crm_profiling/test/process | |
| parent | d34a0d0e1762a73e1ac3fdcf3634c1b7cd669b15 (diff) | |
| parent | 216d028ad66c59bec3018cff954d9b49ba264920 (diff) | |
[MERGE] crm_profiling: convert wizard to osv_memory
bzr revid: rco@openerp.com-20111213110120-1ft3qibvw54s9rkh
Diffstat (limited to 'addons/crm_profiling/test/process')
| -rw-r--r-- | addons/crm_profiling/test/process/profiling.yml | 73 |
1 files changed, 66 insertions, 7 deletions
diff --git a/addons/crm_profiling/test/process/profiling.yml b/addons/crm_profiling/test/process/profiling.yml index 91c48410f8d..99fe2da1733 100644 --- a/addons/crm_profiling/test/process/profiling.yml +++ b/addons/crm_profiling/test/process/profiling.yml @@ -1,10 +1,69 @@ +- | + I check segmentation which allows users to perform segmentation within partners. - - I check segmentation which allows users to perform segmentation within partners - and set the category according to question, so first compute questions(answers) - scenario with parther and check that category set according to questions. + I create a crm profiling question record. +- + !record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}: + answers_ids: + - name: 'no' + name: OpenERP partner? +- + I create a crm profiling answer 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 "John" 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 + +- + Define the answers and category to partner. - !python {model: res.partner}: | - data ={'form': {'quest_form3': ref("partner_quality3"), 'quest_form2': ref("nb_employees2"),'quest_form1': ref("sector1"),'questionnaire_name': ref('questionnaire1')}, 'ids': [ref('base.res_partner_ericdubois0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('base.res_partner_ericdubois0')} - data = self._questionnaire_compute(cr, uid, data, context) - partner = self.browse(cr, uid, ref('base.res_partner_ericdubois0')) - assert partner.category_id[0].id == ref("base.res_partner_category_17"), "Category not assign properly" + data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')} + context['active_id'] = ref('res_partner_john0') + self._questionnaire_compute(cr, uid, [ref('crm_profiling_answer_openerppartner0')], 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 a 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 of segmentation. +- + !python {model: crm.segmentation}: | + self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False) + |
