[IMP]: base_calendar, crm: Minor Improvements in view
[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: '2010-04-30 16:00:00'
7         date_deadline: '2010-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         rrule_type: none
14 -   |
15     Now I will set recurrence for this event to occure monday and friday of week
16 -
17     !python {model: calendar.event}: |
18      self.write(cr, uid, [ref("calendar_event_technicalpresentation0")], {'fr': 1, 'mo': 1, 'interval': 1, 'freq': 'weekly', 'rrule_type': 'custom'})
19 -   |
20     In order to check that recurrent events are views successfully in calenadar view,
21     I will open calendar view of events
22 -
23     !python {model: calendar.event}: |
24      self.fields_view_get(cr, uid, False, 'calendar', context)
25 -   |
26     In order to check that recurrent events are views successfully in calenadar view,
27     I will search for one of the recurrent event and count the number of events
28 -
29     !python {model: calendar.event}: |
30      ids = self.search(cr, uid, [('date', '>=', '2010-05-01 00:00:00'), ('date', '<=', '2010-05-31 00:00:00')] )
31      assert len(ids) == 9
32 -   |
33     Now I will make All day event and test it
34 -
35     !record {model: calendar.event, id: calendar_event_alldaytestevent0}:
36         allday: 1
37         class: confidential
38         date: '2010-04-30 00:00:00'
39         date_deadline: '2010-04-30 00:00:00'
40         description: 'All day technical test '
41         location: School
42         name: All day test event
43         rrule_type: none
44 -   |
45     In order to check reminder I will first create reminder 
46
47   !record {model: res.alarm, id: res_alarm_daybeforeeventstarts0}:
48     name: 1 Day before event starts
49     trigger_duration: 1
50     trigger_interval: days
51     trigger_occurs: before
52     trigger_related: start
53 -   |
54     Now I will assign this reminder to all day event
55 -
56     !python {model: calendar.event}: |
57      self.write(cr, uid, [ref("calendar_event_alldaytestevent0")], {'alarm_id': ref("res_alarm_daybeforeeventstarts0")})
58 -   |
59     In order to assign attendee I will invite Demo user
60
61   !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}:
62     type: internal
63     partner_id: base.res_partner_9 # Put bcz of problem in read
64     user_ids:
65       - base.user_demo
66 -   |
67     Then I click on Invite Button
68 -
69     !python {model: base_calendar.invite.attendee}: |
70      self.do_invite(cr, uid, [ref("base_calendar_invite_attendee_0")], {'active_id': ref("calendar_event_alldaytestevent0"), 'model' : 'calendar.event', 'attendee_field':'attendee_ids'})
71 -   |
72     Now I will Accept this invitation
73 -
74     !python {model: calendar.attendee}: |
75         ids = self.search(cr, uid, [('ref', '=', 'calendar.event' + ',' + str(ref("calendar_event_alldaytestevent0")))])
76         if ids:
77             self.do_accept(cr, uid, ids, context=context)