Skip to content
Snippets Groups Projects
Commit b60a06f0 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-153: fixed test

parent 7f0445fb
No related branches found
No related tags found
1 merge request!102Resolve TMSS-153
...@@ -46,14 +46,15 @@ class TMSSPostgresTestMixinTestCase(TMSSPostgresTestMixin, unittest.TestCase): ...@@ -46,14 +46,15 @@ class TMSSPostgresTestMixinTestCase(TMSSPostgresTestMixin, unittest.TestCase):
def test_db_basics(self): def test_db_basics(self):
'''Can we do some simple plain sql queries?''' '''Can we do some simple plain sql queries?'''
with PostgresDatabaseConnection(self.dbcreds) as db: with PostgresDatabaseConnection(self.dbcreds) as db:
self.assertEqual(0, db.executeQuery("SELECT COUNT(*) FROM tmssapp_cycle;", fetch=FETCH_ONE)['count']) cycle_count = db.executeQuery("SELECT COUNT(*) FROM tmssapp_cycle;", fetch=FETCH_ONE)['count']
self.assertGreaterEqual(cycle_count, 0)
now = datetime.utcnow() now = datetime.utcnow()
db.executeQuery('''INSERT INTO tmssapp_cycle VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);''', db.executeQuery('''INSERT INTO tmssapp_cycle VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);''',
qargs=([], now, now, "my_description", "my_name", now, now, 0, 1, 2, 3)) qargs=([], now, now, "my_description", "my_name", now, now, 0, 1, 2, 3))
self.assertEqual(1, db.executeQuery("SELECT COUNT(*) FROM tmssapp_cycle;", fetch=FETCH_ONE)['count']) self.assertEqual(cycle_count+1, db.executeQuery("SELECT COUNT(*) FROM tmssapp_cycle;", fetch=FETCH_ONE)['count'])
if __name__ == "__main__": if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment