Merge lp:~uonedb-qt/u1db-qt/dateStrings into lp:u1db-qt

Proposed by Christian Dywan on 2015-08-07
Status: Needs review
Proposed branch: lp:~uonedb-qt/u1db-qt/dateStrings
Merge into: lp:u1db-qt
Diff against target: 26 lines (+16/-0)
1 file modified
tests/tst_database.qml (+16/-0)
To merge this branch: bzr merge lp:~uonedb-qt/u1db-qt/dateStrings
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-08-10
U1DB Qt developers 2015-08-07 Pending
Review via email: mp+267371@code.launchpad.net

Commit message

Test storing and retrieving of date strings

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Didier Roche (didrocks) wrote :

This test pass, but I wonder if it's not because the timezone is in UTC, I guess you should explicitely change the timzeone in the test (or add another test which changes the timezone before putting it in the database)

lp:~uonedb-qt/u1db-qt/dateStrings updated on 2015-08-10
127. By Christian Dywan on 2015-08-10

No need to hard-code a date for testing

Christian Dywan (kalikiana) wrote :

> This test pass, but I wonder if it's not because the timezone is in UTC, I
> guess you should explicitely change the timzeone in the test (or add another
> test which changes the timezone before putting it in the database)

I used the exact string you gave me as an example. It would help if you could tell me how you get the date string to begin with - Date.toISOString() always uses UTC and there's no standard Javascript method to get an ISO string with a timezone.

Christian Dywan (kalikiana) wrote :

> This test pass, but I wonder if it's not because the timezone is in UTC, I
> guess you should explicitely change the timzeone in the test (or add another
> test which changes the timezone before putting it in the database)

I used the exact string you gave me as an example. It would help if you could tell me how you get the date string to begin with - Date.toISOString() always uses UTC and there's no standard Javascript method to get an ISO string with a timezone.

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

127. By Christian Dywan on 2015-08-10

No need to hard-code a date for testing

126. By Christian Dywan on 2015-08-07

Test storing and retrieving of date strings

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/tst_database.qml'
2--- tests/tst_database.qml 2013-08-12 15:28:13 +0000
3+++ tests/tst_database.qml 2015-08-10 17:45:40 +0000
4@@ -139,6 +139,22 @@
5 // FIXME compare(myDatabase.last_row_loaded, false)
6 }
7
8+ function test_7_dates_data() {
9+ return [
10+ { 'tag': 'memory', path: ':memory:' },
11+ { 'tag': 'file', path: 'aDatabaseD' },
12+ ]
13+ }
14+ function test_7_dates (data) {
15+ myDatabase.path = data.path
16+ spyPathChanged.wait()
17+ var when = new Date()
18+ var appointment = { 'title': "Doctor's appointment", 'date': when.toISOString() }
19+ myDatabase.putDoc(appointment, 'docDate')
20+ var reminder = myDatabase.getDoc('docDate')
21+ compare(appointment.date, reminder.date, 'Date string not retrieved correctly')
22+ }
23+
24 SignalSpy {
25 id: spyPathChanged
26 target: myDatabase

Subscribers

People subscribed via source and target branches

to all changes: