Merge lp:~nskaggs/ubuntu-calendar-app/assert-with-utc into lp:ubuntu-calendar-app

Proposed by Nicholas Skaggs
Status: Merged
Merged at revision: 276
Proposed branch: lp:~nskaggs/ubuntu-calendar-app/assert-with-utc
Merge into: lp:ubuntu-calendar-app
Diff against target: 97 lines (+9/-10)
4 files modified
tests/autopilot/calendar_app/tests/test_dayview.py (+4/-4)
tests/autopilot/calendar_app/tests/test_monthview.py (+1/-1)
tests/autopilot/calendar_app/tests/test_weekview.py (+3/-4)
tests/autopilot/calendar_app/tests/test_yearview.py (+1/-1)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-calendar-app/assert-with-utc
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Ubuntu Calendar Developers Pending
Review via email: mp+220379@code.launchpad.net

Commit message

Fix AP tests to use utc date/time, to match qml properties.

Description of the change

Fix AP tests to use utc date/time, to match qml properties.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/calendar_app/tests/test_dayview.py'
2--- tests/autopilot/calendar_app/tests/test_dayview.py 2014-02-24 15:58:49 +0000
3+++ tests/autopilot/calendar_app/tests/test_dayview.py 2014-05-21 07:14:31 +0000
4@@ -9,7 +9,7 @@
5 Calendar app autopilot tests for the day view.
6 """
7
8-import datetime
9+from datetime import datetime
10
11 # from __future__ import range
12 # (python3's range, is same as python2's xrange)
13@@ -38,7 +38,7 @@
14 def test_current_month_and_year_is_selected(self):
15 """By default, the day view shows the current month and year."""
16
17- now = datetime.datetime.now()
18+ now = datetime.utcnow()
19
20 expected_year = now.year
21 expected_month_name = now.strftime("%B")
22@@ -59,7 +59,7 @@
23 days = self.day_view.select_many(objectName="dateLabel")
24 days = [int(day.text) for day in days]
25
26- now = datetime.datetime.now()
27+ now = datetime.utcnow()
28
29 today = now.day
30 tomorrow = (now + datetime.timedelta(days=1)).day
31@@ -78,7 +78,7 @@
32 self.change_days(-1)
33
34 def change_days(self, direction):
35- now = datetime.datetime.now()
36+ now = datetime.utcnow()
37
38 for i in range(1, 5):
39 #prevent timing issues with swiping
40
41=== modified file 'tests/autopilot/calendar_app/tests/test_monthview.py'
42--- tests/autopilot/calendar_app/tests/test_monthview.py 2014-01-09 23:30:55 +0000
43+++ tests/autopilot/calendar_app/tests/test_monthview.py 2014-05-21 07:14:31 +0000
44@@ -55,7 +55,7 @@
45 Eventually(Equals(after.year)))
46
47 def _assert_today(self):
48- today = datetime.today()
49+ today = datetime.utcnow()
50 self.assertThat(lambda: self.month_view.currentMonth.datetime.day,
51 Eventually(Equals(today.day)))
52 self.assertThat(lambda: self.month_view.currentMonth.datetime.month,
53
54=== modified file 'tests/autopilot/calendar_app/tests/test_weekview.py'
55--- tests/autopilot/calendar_app/tests/test_weekview.py 2014-03-26 22:03:46 +0000
56+++ tests/autopilot/calendar_app/tests/test_weekview.py 2014-05-21 07:14:31 +0000
57@@ -15,8 +15,7 @@
58 if sys.version_info < (3,):
59 range = xrange
60
61-import datetime
62-
63+from datetime import datetime
64 from autopilot.matchers import Eventually
65 from testtools.matchers import Equals, NotEquals
66
67@@ -112,7 +111,7 @@
68 def test_current_month_and_year_is_selected(self):
69 """By default, the week view shows the current month and year."""
70
71- now = datetime.datetime.now()
72+ now = datetime.utcnow()
73
74 expected_year = now.year
75 expected_month_name = now.strftime("%B")
76@@ -126,7 +125,7 @@
77 def test_current_week_is_selected(self):
78 """By default, the week view shows the current week."""
79
80- now = datetime.datetime.now()
81+ now = datetime.utcnow()
82 days = self._get_days_of_week()
83 day_headers = self._get_date_label_headers()
84
85
86=== modified file 'tests/autopilot/calendar_app/tests/test_yearview.py'
87--- tests/autopilot/calendar_app/tests/test_yearview.py 2014-03-01 02:30:58 +0000
88+++ tests/autopilot/calendar_app/tests/test_yearview.py 2014-05-21 07:14:31 +0000
89@@ -115,7 +115,7 @@
90 Equals(datetime.now().year))
91
92 def current_month(self):
93- now = datetime.now()
94+ now = datetime.utcnow()
95 current_month_name = now.strftime("%B")
96
97 # for months after June, we must scroll down the page to have

Subscribers

People subscribed via source and target branches

to status/vote changes: