summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-10-12 23:02:12 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2018-10-12 23:02:12 -0400
commit7405392299492c83e6fa1546d3b36f52042e3c5e (patch)
tree324c08f17c4d9620b810c6444e4cccd4ae8016f5 /test/dialect/postgresql
parent21fbb5e38f04affb8ac4502428672b3a629c2bec (diff)
downloadsqlalchemy-7405392299492c83e6fa1546d3b36f52042e3c5e.tar.gz
- 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
Diffstat (limited to 'test/dialect/postgresql')
-rw-r--r--test/dialect/postgresql/test_dialect.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py
index 3db7fef48..699a8aaaf 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(