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-Tag: rel_1_3_0b1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7405392299492c83e6fa1546d3b36f52042e3c5e;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 --- diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py index 3db7fef48b..699a8aaaf3 100644 --- a/test/dialect/postgresql/test_dialect.py +++ b/test/dialect/postgresql/test_dialect.py @@ -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(