418acdf75357cce94ca6f3e8605f3ac3421b3808
[odoo/odoo.git] / addons / crm_helpdesk / test / test_crm_helpdesk.yml
1 -
2   |
3   I start by creating New helpdesk request regarding some functional questions.
4   I select Date at which helpdesk request is created.
5
6   !record {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}:
7     date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
8     email_from: info@balmerinc.be
9     name: Some functional question.
10     partner_address_id: base.res_partner_address_1
11     partner_id: base.res_partner_9
12     section_id: crm.section_sales_department
13 -
14   Create the message.
15 -
16   !python {model: crm.helpdesk}: |
17     msg = {
18        'subject': 'test_email',
19        'body': 'Testing',
20        'from': 'Administrator <admin@openerp.com>',
21       }
22     context = None
23     self.message_new(cr, uid,msg,context)
24
25 - |
26   I check that the Helpdesk request  is in 'Draft' state.
27 -
28   !assert {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: 
29     - state == 'draft'  
30 - |
31   In order to make this helpdesk request to be considered I make it "Open"
32 -
33   !python {model: crm.helpdesk}: |
34     self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')])  
35 -
36   Update the created message.
37 -
38   !python {model: crm.helpdesk}: |
39     vals = {}
40     msg = {
41        'subject': 'test_email',
42        'body': 'Testing',
43        'from': 'Administrator <admin@openerp.com>',
44       }
45     context = None
46     default_act = 'pending'
47     self.message_update(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')], vals, msg, default_act, context)    
48 - |
49   After a proper communication for the request via email I make sure that the request is fulfilled and
50   I close this HelpDesk Request by clicking on "Close" button.
51
52   !python {model: crm.helpdesk}: |
53     self.case_close(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')])