parse_value: interger != float
[odoo/odoo.git] / addons / base_calendar / test / base_calendar_test.yml
1 -
2   In Order to test base_calendar, I will first create One Simple Event with real data
3 -
4     !record {model: calendar.event, id: calendar_event_technicalpresentation0}:
5         class: private
6         date: '2011-04-30 16:00:00'
7         date_deadline: '2011-04-30 18:30:00'
8         description: The Technical Presentation will cover following topics:\n* Creating OpenERP
9           class\n* Views\n* Wizards\n* Workflows
10         duration: 2.5
11         location: OpenERP S.A.
12         name: Technical Presentation
13 -
14   Now I will set recurrence for this event to occur monday and friday of week
15 -
16     !python {model: calendar.event}: |
17      data = {'fr': 1, 'mo': 1, 'interval': 1, 'rrule_type': 'weekly', 'end_type': 'end_date', 'end_date': '2011-05-31 00:00:00', 'recurrency' : True}
18      self.write(cr, uid, [ref("calendar_event_technicalpresentation0")], data)
19 -
20   In order to check that recurrent events are views successfully in calendar view, I will open calendar view of events
21 -
22     !python {model: calendar.event}: |
23      self.fields_view_get(cr, uid, False, 'calendar', context)
24 -
25   In order to check that recurrent events are views successfully in calendar view, I will search for one of the recurrent event and count the number of events
26 -
27     !python {model: calendar.event}: |
28      ids = self.search(cr, uid, [('date', '>=', '2011-04-30 16:00:00'), ('date', '<=', '2011-05-31 00:00:00')], context={'virtual_id': True} )
29      assert len(ids) == 9, 'Wrong number of events found'
30 -
31   Now I will make All day event and test it
32 -
33     !record {model: calendar.event, id: calendar_event_alldaytestevent0}:
34         allday: 1
35         class: confidential
36         date: '2011-04-30 00:00:00'
37         date_deadline: '2011-04-30 00:00:00'
38         description: 'All day technical test '
39         location: School
40         name: All day test event
41 -
42   In order to check reminder I will first create reminder
43 -
44   !record {model: res.alarm, id: res_alarm_daybeforeeventstarts0}:
45     name: 1 Day before event starts
46     trigger_duration: 1
47     trigger_interval: days
48     trigger_occurs: before
49     trigger_related: start
50 -
51   Now I will assign this reminder to all day event
52 -
53     !python {model: calendar.event}: |
54      self.write(cr, uid, [ref("calendar_event_alldaytestevent0")], {'alarm_id': ref("res_alarm_daybeforeeventstarts0")})
55 -
56   I create a recuring rule for my event
57 -
58   !record {model: crm.meeting, id: crm_meeting_sprintreview1}:
59     name: Begin of month meeting
60     date: !eval time.strftime('%Y-%m-%d 12:00:00')
61     recurrency: true
62     rrule: FREQ=MONTHLY;INTERVAL=1;COUNT=12;BYDAY=1MO
63 -
64   I check that the attributes are set correctly
65 -
66   !assert {model: crm.meeting, id: crm_meeting_sprintreview1}:
67     - rrule_type == 'monthly'
68     - count == 12
69     - select1 == 'day'
70     - byday == '1'
71     - week_list == 'MO'