Merge lp:~carla-sella/ubuntu-calendar-app/fix-dayview-default-view into lp:ubuntu-calendar-app

Proposed by Carla Sella on 2015-04-29
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„ on 2015-05-18
Approved revision: 618
Merged at revision: 647
Proposed branch: lp:~carla-sella/ubuntu-calendar-app/fix-dayview-default-view
Merge into: lp:ubuntu-calendar-app
Prerequisite: lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber
Diff against target: 35 lines (+10/-3)
2 files modified
tests/autopilot/calendar_app/__init__.py (+1/-2)
tests/autopilot/calendar_app/tests/test_dayview.py (+9/-1)
To merge this branch: bzr merge lp:~carla-sella/ubuntu-calendar-app/fix-dayview-default-view
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-05-07
Nicholas Skaggs 2015-04-29 Pending
Review via email: mp+257814@code.launchpad.net

Commit Message

Fixing weed number issue in DayView test default view.

Description of the Change

Fixes Week number issue in DayView test default view.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/calendar_app/__init__.py'
2--- tests/autopilot/calendar_app/__init__.py 2015-04-17 19:49:43 +0000
3+++ tests/autopilot/calendar_app/__init__.py 2015-05-07 18:07:15 +0000
4@@ -647,8 +647,7 @@
5
6 @autopilot.logging.log_action(logger.info)
7 def get_timeline_header(self, day):
8- """Return the dayheader for a given day. If no day is given,
9- return the current day.
10+ """Return the dayheader for a given day.
11
12 :param day: day in date(year, month, day) format
13 :return: The day header object
14
15=== modified file 'tests/autopilot/calendar_app/tests/test_dayview.py'
16--- tests/autopilot/calendar_app/tests/test_dayview.py 2015-05-07 18:07:15 +0000
17+++ tests/autopilot/calendar_app/tests/test_dayview.py 2015-05-07 18:07:15 +0000
18@@ -75,8 +75,16 @@
19 self.assertEquals(
20 self.day_view.get_datelabel(today).text, str(now.day))
21
22- week = int(now.strftime("%U"))+1
23+ # Qt locale will return 0 for Sunday as first day of week
24+ # and will return 1 for monday.
25+ first_day_of_week = self.day_view.get_timeline_header(today).\
26+ firstDayOfWeek
27+ if first_day_of_week == 1:
28+ week = int(now.strftime("%W"))+1
29+ elif first_day_of_week == 0:
30+ week = int(now.strftime("%U"))+1
31
32+ logger.warn(first_day_of_week)
33 logger.warn(now)
34 logger.warn(str(week))
35 logger.warn(self.day_view.get_weeknumer(today).text)

Subscribers

People subscribed via source and target branches

to status/vote changes: