]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
set UTC timezone on the connection here so we can get consistent results
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 29 Jun 2013 15:08:07 +0000 (11:08 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 29 Jun 2013 15:08:32 +0000 (11:08 -0400)
test/dialect/postgresql/test_query.py

index 9335c5bbc12b3322bc063246ad2fe3c1f573fb63..ee5800db0fc95c7fcfe43a34facdd899d9d3c132 100644 (file)
@@ -757,7 +757,12 @@ class ExtractTest(fixtures.TablesTest):
             def utcoffset(self, dt):
                 return datetime.timedelta(hours=4)
 
-        testing.db.execute(
+        conn = testing.db.connect()
+
+        # we aren't resetting this at the moment but we don't have
+        # any other tests that are TZ specific
+        conn.execute("SET SESSION TIME ZONE 0")
+        conn.execute(
             cls.tables.t.insert(),
             {
                 'dtme': datetime.datetime(2012, 5, 10, 12, 15, 25),
@@ -782,10 +787,8 @@ class ExtractTest(fixtures.TablesTest):
         elif field == 'all+tz':
             fields = {"year": 2012, "month": 5, "day": 10,
                                 "epoch": 1336637725.0,
-                                "hour": 4,
-                                # can't figure out how to get a specific
-                                # tz into the DB
-                                #"timezone": -14400
+                                "hour": 8,
+                                "timezone": 0
                                 }
         else:
             fields = field
@@ -827,7 +830,7 @@ class ExtractTest(fixtures.TablesTest):
     def test_five(self):
         t = self.tables.t
         self._test(func.coalesce(t.c.dtme, func.current_timestamp()),
-                    overrides={"epoch": 1336666525.0})
+                    overrides={"epoch": 1336652125.0})
 
     def test_six(self):
         t = self.tables.t