[IMP] improves the reporting view Expenses Analysis (add some measures to the table...
[odoo/odoo.git] / addons / survey / test / draft2open2close_survey.yml
1 -
2   In order to check the survey module in OpenERP I use the survey "Initial Partner Feedback".
3 -
4   I set the survey in Open state.
5 -
6   !python {model: survey}: |
7     sur = self.survey_open(cr, uid, [ref("survey_Initial_partner_feedback")], context)
8 -
9   I check state of survey is open or not.
10 -
11   !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in open state}:
12     - state == 'open'
13 -
14   I check that the survey is reopened or not.
15 -
16   !python {model: survey}: |
17     self.survey_cancel(cr, uid, [ref('survey_Initial_partner_feedback')],context)
18     self.survey_open(cr, uid, [ref('survey_Initial_partner_feedback')],context)
19 -
20   I check that state of survey is open or not.
21 -
22   !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in open state}:
23     - state == 'open'
24 -
25   I set the state of the survey open.
26 -
27   !python {model: survey}: |
28     sur = self.survey_open(cr, uid, [ref("survey_Initial_partner_feedback")], context)
29 -
30   In order to print the survey I click on Print.
31 -
32   !python {model: survey.print}: |
33     id = self.create(cr, uid, {'survey_ids': [(6,0,[ref('survey.survey_Initial_partner_feedback')])]})
34     self.action_next(cr, uid, [id], context)
35 -
36   In order to answer the survey I click on "Answer a Survey" wizard.
37 -
38   !python {model: survey.name.wiz}: |
39     id = self.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
40     self.action_next(cr, uid, [id], context)
41 -
42   I give the answer of the first and second page of the survey.
43 -
44   !python {model: survey.question.wiz}: |
45     ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')]}
46     self.fields_view_get(cr, uid, ref("survey.view_survey_question_message"),"form", context=ctx)
47     values = self.default_get(cr, uid, ['name'], ctx)
48     id = self.create(cr, uid, {str(ref("survey_initial_question_company_name")) +"_single" :'Tiny' , str(ref("survey_initial_question_company_size")) + "_selection" : int(ref("survey.survey_initial_question_company_size_51")), }, context)
49     self.action_next(cr, uid, [id], context)
50     id = self.create(cr, uid, {str(ref("survey_initial_question_contract_customers")) + "_selection" : int(ref("survey_initial_answer_sometimes")), str(ref("survey_initial_question_sell_to_your_customers")) + "_selection" : int(ref("survey_initial_answer_maintenance_contract")), }, context)
51     self.action_next(cr, uid, [id], context)
52 -
53   I print the answers of the survey.
54 -
55   !python {model: survey.browse.answer}: |
56     id = self.create(cr, uid, {'survey_id': ref('survey.survey_Initial_partner_feedback')})
57     self.action_next(cr, uid, [id], context)
58 -
59   I edit questions of the survey as per requirement.
60 -
61   !python {model: survey.question.wiz}: |
62     name_wiz_obj = self.pool.get('survey.name.wiz')
63     id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
64     ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')], 'question_id': ref('survey_initial_question_company_name'), 'page_number': -1,'sur_name_id': id}
65     self.action_edit_question(cr, uid, [ref('survey_initial_question_company_name')], context = ctx)
66     self.action_delete_question(cr, uid, [ref('survey_initial_question_company_name')], context = ctx)
67     self.action_new_question(cr, uid, [], context = ctx)
68 -
69   I edit Page of the survey as per requirement.
70 -
71   !python {model: survey.question.wiz}: |
72     name_wiz_obj = self.pool.get('survey.name.wiz')
73     id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
74     ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')], 'page_id': ref('survey_initial_page_Contracts'), 'sur_name_id': id}
75     self.action_edit_page(cr, uid, [ref('survey_initial_page_Contracts')], context = ctx)
76     self.action_delete_page(cr, uid, [ref('survey_initial_page_Contracts')], context = ctx)
77     self.action_new_page(cr, uid, [], context = ctx)
78 -
79   In order to send invitation to the users I click on "Send Invitation" wizard.
80 -
81   !python {model: survey.send.invitation}: |
82     context = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')]}
83     values = self.default_get(cr, uid, ['mail_from', 'mail_subject', 'send_mail_existing', 'mail_subject_existing', 'mail', 'partner_ids', 'send_mail'], context)
84     values['mail_from'] = 'Surveyor'
85     new_id = self.create(cr, uid, values)
86     self.action_send(cr, uid, [new_id], context)
87 -
88   I set the value in "Total start survey" field.
89 -
90   !record {model: survey, id: survey_Initial_partner_feedback}:
91     tot_start_survey: 1
92 -
93   I set the survey in Cancel state.
94 -
95   !python {model: survey}: |
96     self.survey_cancel(cr, uid, [ref("survey_Initial_partner_feedback")], context)
97 -
98   I check state of survey is cancel or not.
99 -
100   !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in cancel state}:
101     - state == 'cancel'
102 -
103   I set the survey in close state.
104 -
105   !python {model: survey}: |
106     self.survey_close(cr, uid, [ref("survey_Initial_partner_feedback")], context)
107 -
108   I check state of Survey is close or not.
109 -
110   !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in close state}:
111     - state == 'close'