]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- get the "now" date for this test in terms of the database to accommodate
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 Oct 2018 03:02:12 +0000 (23:02 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 Oct 2018 03:02:45 +0000 (23:02 -0400)
for local timezone doesn't match that of the DB

Change-Id: I0899d9294e8a2bd8f7f2c3e66cf396e2e8bd4bcc
(cherry picked from commit 7405392299492c83e6fa1546d3b36f52042e3c5e)

test/dialect/postgresql/test_dialect.py

index 446765872e3da817cfcad5739a5eeb319e968252..4aa5ccec9bde86cac18bed8c59d35e8087e24465 100644 (file)
@@ -181,8 +181,8 @@ class MiscBackendTest(
                       "Can't infer the SQL type to use for an instance "
                       "of org.python.core.PyObjectDerived.")
     def test_extract(self):
-        fivedaysago = datetime.datetime.now() \
-            datetime.timedelta(days=5)
+        fivedaysago = testing.db.scalar(select([func.now()])) - \
+            datetime.timedelta(days=5)
         for field, exp in ('year', fivedaysago.year), \
                 ('month', fivedaysago.month), ('day', fivedaysago.day):
             r = testing.db.execute(