From: Mike Bayer Date: Sat, 13 Oct 2018 03:02:12 +0000 (-0400) Subject: - get the "now" date for this test in terms of the database to accommodate X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed735af55d2c863cbe7cfde7b4ef3a9cda7c0733;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - get the "now" date for this test in terms of the database to accommodate for local timezone doesn't match that of the DB Change-Id: I0899d9294e8a2bd8f7f2c3e66cf396e2e8bd4bcc (cherry picked from commit 7405392299492c83e6fa1546d3b36f52042e3c5e) --- diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py index 446765872e..4aa5ccec9b 100644 --- a/test/dialect/postgresql/test_dialect.py +++ b/test/dialect/postgresql/test_dialect.py @@ -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(