585c6af73ae6db75ed38cfb8807f13ab5bc9d6d5
[odoo/odoo.git] / addons / crm / test / test_crm_recurrent_meeting_case2.yml
1 -
2   In order to test recurrent meetings in OpenERP, I create meetings with different recurrency using different test cases.
3 -
4   I create a recurrent meeting with daily recurrency and fixed amount of time.
5
6   !record {model: crm.meeting, id: crm_meeting_testmeeting0}:
7     count: 5
8     date: '2011-04-13 11:04:00'
9     date_deadline: '2011-04-13 12:04:00'
10     day: 0.0
11     duration: 1.0
12     name: Test Meeting
13     recurrency: true
14     recurrent_uid: 0.0
15     rrule_type: daily
16     sequence: 0.0
17 -
18   I search for all the recurrent meetings.
19 -
20   !python {model: crm.meeting}: |
21      meeting_ids = self.search(cr, uid, [('id', 'in', [ref('crm_meeting_testmeeting0')]),('date','>=','2011-03-13'), ('date_deadline', '<=', '2011-05-13')], context={'virtual_id': True})
22      assert len(meeting_ids) == 5, 'Recurrent daily meetings are not created !'
23 -
24   Now I create a weekly meeting till a particular end date.
25 -
26   !record {model: crm.meeting, id: crm_meeting_reviewcodewithprogrammer0}:
27     date: '2011-04-18 11:47:00'
28     date_deadline: '2011-04-18 12:47:00'
29     day: 0.0
30     duration: 1.0
31     end_date: '2011-04-30'
32     end_type: end_date
33     fr: true
34     mo: true
35     th: true
36     tu: true
37     we: true
38     name: Review code with programmer
39     recurrency: true
40     recurrent_uid: 0.0
41     rrule_type: weekly
42     sequence: 0.0
43 -
44   I search for all the recurrent weekly meetings.
45 -
46   !python {model: crm.meeting}: |
47      meeting_ids = self.search(cr, uid, [('id', 'in', [ref('crm_meeting_reviewcodewithprogrammer0')]),('date','>=','2011-03-13'), ('date_deadline', '<=', '2011-05-13')], context={'virtual_id': True})
48      assert len(meeting_ids) == 10, 'Recurrent weekly meetings are not created !'
49 -
50   I want to schedule a meeting every month for Sprint review.
51
52   !record {model: crm.meeting, id: crm_meeting_sprintreview0}:
53     count: 12
54     date: '2011-04-01 12:01:00'
55     date_deadline: '2011-04-01 13:01:00'
56     day: 1
57     duration: 1.0
58     name: Sprint Review
59     recurrency: true
60     recurrent_uid: 0.0
61     rrule_type: monthly
62     sequence: 0.0
63 -
64   I search for all the recurrent monthly meetings.
65 -
66   !python {model: crm.meeting}: |
67      meeting_ids = self.search(cr, uid, [('id', 'in', [ref('crm_meeting_sprintreview0')]),('date','>=','2011-03-01'), ('date_deadline', '<=', '2012-05-13')], context={'virtual_id': True})
68      assert len(meeting_ids) == 12, 'Recurrent monthly meetings are not created !'
69 -
70   I change name of my monthly Sprint Review meeting.
71 -
72   !python {model: crm.meeting}: |
73      from base_calendar import base_calendar
74      base_cal_id = base_calendar.real_id2base_calendar_id(ref('crm_meeting_sprintreview0'), '2011-09-01 13:01:00')
75      self.write(cr, uid, [base_cal_id], {'name': 'Sprint Review for google modules', 'edit_all': True})
76 -
77   I check whether all the records are edited or not.
78 -
79   !python {model: crm.meeting}: |
80      meeting_ids = self.search(cr, uid, [('id', 'in', [ref('crm_meeting_sprintreview0')]),('date','>=','2011-03-01'), ('date_deadline', '<=', '2012-05-13')], context={'virtual_id': True})
81      meetings = self.browse(cr, uid, meeting_ids, context)
82      for meeting in meetings:
83         assert meeting.name == 'Sprint Review for google modules', 'Name not changed for id: %s' %meeting.id
84 -
85   I change description of my weekly meeting Review code with programmer.
86 -
87   !python {model: crm.meeting}: |
88      from base_calendar import base_calendar
89      base_cal_id = base_calendar.real_id2base_calendar_id(ref('crm_meeting_reviewcodewithprogrammer0'), '2011-04-25 12:47:00')
90      self.write(cr, uid, [base_cal_id], {'description': 'Review code of the module: sync_google_calendar.'})
91 -
92   I check whether the record is edited perfectly or not.
93 -
94   !python {model: crm.meeting}: |
95      meeting_ids = self.search(cr, uid, [('recurrent_uid', '=', ref('crm_meeting_reviewcodewithprogrammer0')), ('recurrent_id','=','2011-04-25 12:47:00')], context)
96      assert meeting_ids, 'Meeting is not edited !'
97
98