This change causes table wrregion not to be empty after import.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 23 Jul 2017 19:24:05 +0000 (19:24 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 23 Jul 2017 19:24:05 +0000 (19:24 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrfeed/trunk@2658 7aebc617-e5e2-0310-91dc-80fb5f6d2477

tests/test_wrfeed.py

index c057b12dc62d3646a6026fc8554cc01e66b081f0..a202e6fbe10acdf205d0d59a205f10de060c0dda 100644 (file)
@@ -32,14 +32,14 @@ class TestDbWrfeed(WrfeedTestBase):
 
             # connect to database
             self.engine = sqlalchemy.create_engine(uri)
+            con = self.engine.connect()
 
             # fill database
             with open('tests/testdb.sql', 'r') as f:
                 sql = f.read()
-            self.engine.execute(sql)
+            con.execute(sql)
 
             # update dates
-            con = self.engine.connect()
             seconds_diff, = con.execute("SELECT TIMESTAMPDIFF(SECOND, '2017-03-31 07:00', now())").fetchone()
             seconds_diff = int(seconds_diff)
             con.execute("UPDATE wrreport SET date_report = DATE(date_report + INTERVAL %s SECOND) WHERE time_report IS NULL", (seconds_diff,))