~pkunal-parmar/ubuntu-calendar-app/ICalImport

« back to all changes in this revision

Viewing changes to tests/autopilot/calendar_app/tests/test_agendaview.py

  • Committer: Kunal Parmar
  • Date: 2015-02-19 13:50:29 UTC
  • mfrom: (599 trunk)
  • mto: This revision was merged to the branch mainline in revision 600.
  • Revision ID: pkunal.parmar@gmail.com-20150219135029-zdvyum5t747ocdl2
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
 
2
#
 
3
# Copyright (C) 2013, 2014 Canonical Ltd
 
4
#
 
5
# This program is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License version 3 as
 
7
# published by the Free Software Foundation.
 
8
#
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
"""
 
18
Calendar app autopilot tests for the agenda view.
 
19
"""
 
20
 
 
21
from __future__ import absolute_import
 
22
 
 
23
import logging
 
24
 
 
25
from calendar_app.tests import CalendarAppTestCaseWithVcard
 
26
 
 
27
from calendar_app import data
 
28
 
 
29
logger = logging.getLogger(__name__)
 
30
 
 
31
 
 
32
class TestAgendaView(CalendarAppTestCaseWithVcard):
 
33
 
 
34
    def setUp(self):
 
35
        super(TestAgendaView, self).setUp()
 
36
        self.agenda_view = self.app.main_view.go_to_agenda_view()
 
37
 
 
38
    def test_selecting_event_opens_it(self):
 
39
        test_event = data.Event.make_unique()
 
40
 
 
41
        new_event_page = self.app.main_view.go_to_new_event()
 
42
        new_event_page.add_event(test_event)
 
43
 
 
44
        self.agenda_view.open_event(test_event.name)
 
45
        event_details_page = self.app.main_view.get_event_details()
 
46
        event_details = event_details_page.get_event_information()
 
47
 
 
48
        self.assertEquals(event_details.name, test_event.name)
 
49
        self.assertEquals(event_details.description, test_event.description)
 
50
        self.assertEquals(event_details.calendar, test_event.calendar)
 
51
        self.assertEquals(event_details.location, test_event.location)
 
52
        self.assertEquals(event_details.guests, test_event.guests)