3 from db_test import DBDakTestCase
5 from daklib.dbconn import DBConn, Uid
10 class TimestampTestCase(DBDakTestCase):
12 TimestampTestCase checks that the timestamps created and modified are
15 TODO: Should we check all tables?
21 def test_timestamps(self):
22 timestamp01 = self.now()
23 self.session.rollback()
25 uid = Uid(uid = 'ftp-master@debian.org')
28 created01 = uid.created
29 modified01 = uid.modified
31 timestamp02 = self.now()
32 self.session.rollback()
33 self.assertTrue(timestamp01 < created01)
34 self.assertTrue(timestamp01 < modified01)
35 self.assertTrue(created01 < timestamp02)
36 self.assertTrue(modified01 < timestamp02)
40 created02 = uid.created
41 modified02 = uid.modified
42 self.assertEqual(created01, created02)
43 self.assertTrue(modified01 < modified02)
45 self.session.rollback()
46 timestamp03 = self.now()
47 self.assertTrue(modified02 < timestamp03)
49 def classes_to_clean(self):
52 if __name__ == '__main__':