From 21ff4edbed3c9f0c4e36efc12aeeb8f74d2bfad9 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Wed, 20 Mar 2019 16:50:56 +0100 Subject: [PATCH] Update test db - Add user. - Do not use fix date when creating database entries. --- ut/test_db.py | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/ut/test_db.py b/ut/test_db.py index c49396c..5ffecfa 100644 --- a/ut/test_db.py +++ b/ut/test_db.py @@ -52,18 +52,26 @@ insert or ignore into days values """) cur.executescript(""" INSERT INTO users VALUES('1111','tester'); -INSERT INTO coffees VALUES(1,'1111','espresso lungo','2019-03-20 11:22:43'); -INSERT INTO coffees VALUES(2,'1111','Club-Mate 0,5 l','2019-03-20 11:22:43'); -INSERT INTO coffees VALUES(3,'1111','Club-Mate 0,33 l','2019-03-20 11:22:43'); -INSERT INTO coffees VALUES(4,'1111','espresso lungo','2019-03-20 11:22:44'); -INSERT INTO coffees VALUES(5,'1111','Club-Mate 0,5 l','2019-03-20 11:22:44'); -INSERT INTO coffees VALUES(6,'1111','Club-Mate 0,33 l','2019-03-20 11:22:44'); -INSERT INTO coffees VALUES(7,'1111','espresso lungo','2019-03-20 11:22:45'); -INSERT INTO coffees VALUES(8,'1111','Club-Mate 0,5 l','2019-03-20 11:22:45'); -INSERT INTO coffees VALUES(9,'1111','Club-Mate 0,33 l','2019-03-20 11:22:45'); -INSERT INTO coffees VALUES(10,'1111','espresso lungo','2019-03-20 11:22:46'); -INSERT INTO coffees VALUES(11,'1111','Club-Mate 0,5 l','2019-03-20 11:22:46'); -INSERT INTO coffees VALUES(12,'1111','Club-Mate 0,33 l','2019-03-20 11:22:46'); +INSERT INTO users VALUES('2222','newer'); +INSERT INTO coffees (id, flavor, time) VALUES +('1111', 'espresso lungo', datetime('now', 'localtime', '-99 seconds')), +('1111', 'Club-Mate 0,5 l', datetime('now', 'localtime', '-99 seconds')), +('1111', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-99 seconds')), +('1111', 'espresso lungo', datetime('now', 'localtime', '-95 second')), +('1111', 'Club-Mate 0,5 l', datetime('now', 'localtime', '-95 second')), +('1111', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-95 second')), +('1111', 'espresso lungo', datetime('now', 'localtime', '-90 second')), +('1111', 'Club-Mate 0,5 l', datetime('now', 'localtime', '-90 second')), +('1111', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-90 second')), +('1111', 'espresso lungo', datetime('now', 'localtime', '-85 second')), +('1111', 'Club-Mate 0,5 l', datetime('now', 'localtime', '-85 second')), +('1111', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-85 second')), +('2222', 'espresso lungo', datetime('now', 'localtime', '-99 seconds')), +('2222', 'Club-Mate 0,5 l', datetime('now', 'localtime', '-99 seconds')), +('2222', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-99 seconds')), +('2222', 'espresso lungo', datetime('now', 'localtime', '-95 second')), +('2222', 'Club-Mate 0,5 l', datetime('now', 'localtime', '-95 second')), +('2222', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-95 second')); """) con.close() -- 2.39.2