[MERGE] mail/chatter complete review/refactoring
[odoo/odoo.git] / addons / crm_helpdesk / test / process / help-desk.yml
1 -
2   Customer has Questions regarding our service. so He sent questions list by email.
3 -
4   Mail script will be fetched him request from mail server. so I process that mail after read EML file 
5 -
6   !python {model: mail.thread}: |
7     import addons
8     request_file = open(addons.get_module_resource('crm_helpdesk','test', 'customer_question.eml'),'rb')
9     request_message = request_file.read()
10     self.message_process(cr, uid, 'crm.helpdesk', request_message)
11 -
12   After getting the mail, I check details of new question of that customer.
13 -
14   !python {model: crm.helpdesk}: |
15     from openerp import tools
16     question_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
17     assert question_ids and len(question_ids), "Question is not created after getting request"
18     question = self.browse(cr, uid, question_ids[0], context=context)
19     assert question.name == tools.ustr("Where is download link of user manual of your product ? "), "Subject does not match"
20 -
21   Now I Update message according to provide services.
22 -
23   !python {model: crm.helpdesk}: |
24     question_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
25     try:
26       self.message_update(cr, uid, question_ids, {'subject': 'Link of product', 'body': 'www.openerp.com'})
27     except:
28       pass
29
30