]> 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:12 +0000 (23:02 -0400)
for local timezone doesn't match that of the DB

Change-Id: I0899d9294e8a2bd8f7f2c3e66cf396e2e8bd4bcc

test/dialect/postgresql/test_dialect.py

index 3db7fef48b8b511107ca07e5ec6755baaaa8863d..699a8aaaf358792cf6079469e4be634b218744a1 100644 (file)
@@ -263,8 +263,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(