[FIX] a lot of typos in yml tests

also put the phonecall tests apart in a separated yml file

bzr revid: abo@openerp.com-20120927165708-7pu4ka5e0obb8g0l
This commit is contained in:
Antonin Bourguignon 2012-09-27 18:57:08 +02:00
parent d92fe7019a
commit fbab999fe2
7 changed files with 80 additions and 79 deletions

View File

@ -36,7 +36,7 @@ It manages key tasks such as communication, identification, prioritization, assi
OpenERP ensures that all cases are successfully tracked by users, customers and suppliers. It can automatically send reminders, escalate the request, trigger specific methods and many other actions based on your own enterprise rules.
The greatest thing about this system is that users don't need to do anything special. The CRM module has an email gateway for the synchronization interface between mails and OpenERP. That way, users can just send emails to the request tracker.
The greatest thing about this system is that users don't need to do anything special. The CRM module has an email gateway for the synchronization interface between mails and OpenERP. That way, users can just send emails to the request tracker.
OpenERP will take care of thanking them for their message, automatically routing it to the appropriate staff and make sure all future correspondence gets to the right place.
@ -99,7 +99,7 @@ Dashboard for CRM will include:
'res_partner_view.xml',
'board_crm_view.xml',
'res_config_view.xml',
],
@ -115,9 +115,10 @@ Dashboard for CRM will include:
'test/process/cancel_lead.yml',
'test/process/action_rule.yml',
'test/process/segmentation.yml',
'test/process/phonecalls.yml',
'test/ui/crm_demo.yml',
'test/ui/duplicate_lead.yml',
'test/ui/delete_lead.yml'
'test/ui/delete_lead.yml',
],
'installable': True,
'application': True,

View File

@ -7,14 +7,14 @@
new_id = self.create(cr, uid, {'name': 'New Rule', 'model_id': model_ids[0], 'trg_user_id': ref('base.user_root'), 'trg_partner_id': ref('base.res_partner_1'), 'act_user_id': ref('base.user_demo') })
self._check(cr, uid)
-
I create new lead to check record rule.
I create a new lead to check the record rule.
-
!record {model: crm.lead, id: crm_lead_test_rules_id}:
name: 'Test lead rules'
partner_id: base.res_partner_1
-
I check record rule is apply and responsible is changed.
I check if the record rule is applied and the responsible is changed.
-
!python {model: crm.lead}: |
lead_user = self.browse(cr, uid, ref('crm_lead_test_rules_id'))
assert lead_user.user_id.id == ref('base.user_demo'), "Responsible of lead is not changed."
assert lead_user.user_id.id == ref('base.user_demo'), "Responsible of lead is not changed."

View File

@ -10,7 +10,7 @@
lead = self.browse(cr, uid, ref('crm_case_1'))
assert lead.stage_id.id == ref('crm.stage_lead7'), "Stage should be 'Dead' and is %s." % (lead.stage_id.name)
assert lead.state == 'cancel', "Opportunity is not in 'cancel' state."
assert lead.probability == 0.0, 'Opportunity probability is wrong and should be 0.0.'
assert lead.probability == 0.0, 'Opportunity is probably wrong and should be 0.0.'
-
I reset cancelled lead into unqualified lead.
-

View File

@ -15,7 +15,7 @@
lead_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
assert lead_ids and len(lead_ids), "Lead is not created after getting request"
lead = self.browse(cr, uid, lead_ids[0], context=context)
assert not lead.partner_id, "Customer should be a new"
assert not lead.partner_id, "Customer should be a new one"
assert lead.name == "Fournir votre devis avec le meilleur prix.", "Subject does not match"
-
I reply his request with welcome message. TODO revert mail.mail to mail.compose.message (conversion to customer should be automatic).
@ -23,7 +23,7 @@
!python {model: mail.mail}: |
lead_ids = self.pool.get('crm.lead').search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
context.update({'active_model': 'crm.lead','active_id': lead_ids[0]})
id = self.create(cr, uid, {'body': "Merci à l'intérêt pour notre produit.nous vous contacterons bientôt. Merci", 'email_from': 'sales@mycompany.com'}, context=context)
id = self.create(cr, uid, {'body': "Merci de votre intérêt pour notre produit, nous vous contacterons bientôt. Bien à vous", 'email_from': 'sales@mycompany.com'}, context=context)
try:
self.send_mail(cr, uid, [id], context=context)
except:
@ -48,5 +48,5 @@
partner_id = self.search(cr, uid, [('phonecall_ids', '=', ref('crm.crm_phonecall_4'))])
assert partner_id, "Customer is not found in regular customer list."
data = self.browse(cr, uid, partner_id, context=context)[0]
assert data.user_id.id == ref("base.user_root"), "User not assign properly"
assert data.user_id.id == ref("base.user_root"), "User not assigned properly"
assert data.name == "Wanted information about pricing of laptops", "Bad partner name"

View File

@ -1,17 +1,17 @@
-
In order to test convert customer lead into opportunity,
In order to test convert customer lead into opportunity,
-
I open customer lead.
-
!python {model: crm.lead}: |
self.case_open(cr, uid, [ref("crm_case_4")])
-
I check lead state is "Open".
-
I check lead state is "Open".
-
!assert {model: crm.lead, id: crm.crm_case_4, string: Lead in open state}:
- state == "open"
-
I create partner from lead.
I create partner from lead.
-
!record {model: crm.lead2partner, id: crm_lead2partner_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_4")]}'}:
-
@ -24,7 +24,7 @@
!python {model: crm.lead}: |
self.convert_opportunity(cr, uid ,[ref("crm_case_4")], ref("base.res_partner_2"))
-
I check details of converted opportunity.
I check details of converted opportunity.
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm_case_4'))
@ -37,15 +37,15 @@
!python {model: crm.opportunity2phonecall}: |
import time
context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_4')]})
call_id = self.create(cr, uid, {'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'name': "Bonjour M. Jean, Comment êtes-vous? J'ai obtenu votre demande. peut-on parler au sujet de ce pour quelques minutes?"}, context=context)
call_id = self.create(cr, uid, {'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'name': "Bonjour M. Jean, Comment allez-vous? J'ai bien reçu votre demande, pourrions-nous en parler quelques minutes?"}, context=context)
self.action_schedule(cr, uid, [call_id], context=context)
-
I check that phonecall is scheduled for that opportunity.
-
!python {model: crm.phonecall}: |
ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_4'))])
assert len(ids), 'phonecall is not scheduled'
assert len(ids), 'Phonecall is not scheduled'
-
Now I schedule meeting with customer.
-
@ -55,7 +55,7 @@
After communicated with customer, I put some notes with contract details.
-
!python {model: crm.lead}: |
self.message_post(cr, uid, [ref('crm_case_4')], subject='Test note', body='ces détails envoyés par le client sur le FAX pour la qualité')
self.message_post(cr, uid, [ref('crm_case_4')], subject='Test note', body='Détails envoyés par le client sur le FAX pour la qualité')
-
I win this opportunity
-
@ -73,7 +73,7 @@
I convert mass lead into opportunity customer.
-
!python {model: crm.lead2opportunity.partner.mass}: |
context.update({'active_model': 'crm.lead', 'active_ids': [ref("crm_case_11"), ref("crm_case_2")], 'active_id': ref("crm_case_11")})
context.update({'active_model': 'crm.lead', 'active_ids': [ref("crm_case_11"), ref("crm_case_2")], 'active_id': ref("crm_case_11")})
id = self.create(cr, uid, {'user_ids': [ref('base.user_root')], 'section_id': ref('crm.section_sales_department')}, context=context)
self.mass_convert(cr, uid, [id], context=context)
-
@ -111,7 +111,7 @@
I confirm review needs meeting.
-
!python {model: crm.meeting}: |
context.update({'active_model': 'crm.meeting'})
context.update({'active_model': 'crm.meeting'})
self.case_open(cr, uid, [ref('base_calendar.crm_meeting_4')])
-
I invite a user for meeting.

View File

@ -1,19 +1,19 @@
-
I make direct opportunity for customer.
I make an opportunity from customer.
-
!python {model: crm.partner2opportunity}: |
context.update({'active_model': 'res.partner', 'active_ids': [ref("base.res_partner_9")]})
res_id = self.create(cr, uid, {'name': "enquête pour l'achat de services"}, context=context)
res_id = self.create(cr, uid, {'name': "Enquête pour l'achat de services"}, context=context)
self.make_opportunity(cr, uid, [res_id], context=context)
-
I make another opportunity from phonecall for same customer.
I make another opportunity from a phone call with the same customer.
-
!python {model: crm.phonecall2opportunity}: |
context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_phonecall_6")]})
res_id = self.create(cr, uid, {'name': "Quoi de prix de votre autre service?", 'partner_id': ref("base.res_partner_9")}, context=context)
res_id = self.create(cr, uid, {'name': "À propos du prix de votre autre service", 'partner_id': ref("base.res_partner_9")}, context=context)
self.make_opportunity(cr, uid, [res_id], context=context)
-
Now I merge all opportunities of customer.
Now I merge these opportunities.
-
!python {model: crm.lead}: |
opportunity_ids = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
@ -24,7 +24,7 @@
!python {model: crm.merge.opportunity}: |
self.action_merge(cr, uid, [ref("opportunity_merge_id")], context=context)
-
I check for merged opportunities for customer.
I check for merged opportunities for customer.
-
!python {model: crm.lead}: |
merge_id = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
@ -32,55 +32,3 @@
merge_data = self.browse(cr, uid, merge_id)[0]
assert merge_data.type == 'opportunity', 'Merged opportunity type not change!'
assert merge_data.partner_id.id == ref("base.res_partner_9"), 'Partner missmatch!'
-
Now I schedule another phonecall to customer after merged.
-
!python {model: crm.phonecall2phonecall}: |
context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_phonecall_6")], 'active_id': ref("crm.crm_phonecall_6")})
res_id = self.create(cr, uid, {'name': "vos chances sont fusionnés en un seul"}, context=context)
self.action_schedule(cr, uid, [res_id], context=context)
-
I schedule meeting on this phonecall.
-
!python {model: crm.phonecall}: |
self.action_make_meeting(cr, uid, [ref("crm.crm_phonecall_6")])
-
I set phone call to not held.
-
!python {model: crm.phonecall}: |
self.case_pending(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Not Held' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call held.}:
- state == "pending"
-
I cancelled the phone call.
-
!python {model: crm.phonecall}: |
self.case_cancel(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Cancelled' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not cancelled.}:
- state == "cancel"
-
I reset the phone call.
-
!python {model: crm.phonecall}: |
self.case_reset(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is reset or not.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not reset.}:
- state == "open"
-
I set phone call to held (done).
-
!python {model: crm.phonecall}: |
self.case_close(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Held' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not held.}:
- state == "done"

View File

@ -0,0 +1,52 @@
-
I schedule a phone call with a customer.
-
!python {model: crm.phonecall2phonecall}: |
context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_phonecall_6")], 'active_id': ref("crm.crm_phonecall_6")})
res_id = self.create(cr, uid, {'name': "Proposition de réduction"}, context=context)
self.action_schedule(cr, uid, [res_id], context=context)
-
I schedule a meeting based on this phone call.
-
!python {model: crm.phonecall}: |
self.action_make_meeting(cr, uid, [ref("crm.crm_phonecall_6")])
-
I set the phone call to not held.
-
!python {model: crm.phonecall}: |
self.case_pending(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Not Held' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call held.}:
- state == "pending"
-
I cancel the phone call.
-
!python {model: crm.phonecall}: |
self.case_cancel(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Cancelled' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not cancelled.}:
- state == "cancel"
-
I reset the phone call.
-
!python {model: crm.phonecall}: |
self.case_reset(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is reset.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not reset.}:
- state == "open"
-
I set phone call to held (done).
-
!python {model: crm.phonecall}: |
self.case_close(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Held' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not held.}:
- state == "done"