~ubuntu-calendar-dev/ubuntu-calendar-app/ViewRedisign

« back to all changes in this revision

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

  • Committer: Mihir Soni
  • Date: 2014-09-16 15:59:20 UTC
  • Revision ID: mihirsoni.123@gmail.com-20140916155920-1i7sui6y6mnwsu3c
Fixed test_current_month_and_year_is_selected ap

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        # sort based on text value of the day
65
65
        days = sorted(self._get_date_label_headers(),
66
66
                      key=lambda label: label.text)
67
 
        days = [int(item.text) for item in days]
 
67
        days = [int(item.text.split(" ")[1]) for item in days]
68
68
 
69
69
        # resort so beginning of next month comes after the end
70
70
        # need to support overlapping months 28,30,31 -> 1
123
123
 
124
124
        now = datetime.datetime.now()
125
125
 
126
 
        expected_year = now.year
127
 
        expected_month_name = now.strftime("%B")
128
 
 
129
 
        self.assertThat(self.app.main_view.get_year(self.week_view),
130
 
                        Equals(expected_year))
131
 
 
132
 
        self.assertThat(self.app.main_view.get_month_name(self.week_view),
133
 
                        Equals(expected_month_name))
 
126
        expected_month_name_year = now.strftime("%B %Y")
 
127
 
 
128
        self.assertThat(self.app.main_view.get_month_year(self.week_view),
 
129
                        Equals(expected_month_name_year))
 
130
 
134
131
 
135
132
    def test_current_week_is_selected(self):
136
133
        """By default, the week view shows the current week."""