summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-06-03 00:54:33 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-06-03 00:54:33 +0100
commit5748ae14bf060aa69c97449d91253b2ba69dd23e (patch)
treeb3997b7919241433fd9ca34549d0d4e370682f0d
parent531292bca5d9d799e00a9162267d908ce561c337 (diff)
downloadpsycopg2-5748ae14bf060aa69c97449d91253b2ba69dd23e.tar.gz
Test tweaked to deal with missing usecs in BC timestamps
Probably depending on compile time options. On my test db usecs are available from PG 8.4.
-rwxr-xr-xtests/test_dates.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_dates.py b/tests/test_dates.py
index db2050a..27abbc1 100755
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
@@ -417,7 +417,11 @@ class mxDateTimeTests(unittest.TestCase, CommonDatetimeTestsMixin):
from mx.DateTime import DateTime
value = self.execute('select (%s)::timestamp::text',
[DateTime(-41, 1, 1, 13, 30, 29.123456)])
- self.assertEqual(value, '0042-01-01 13:30:29.123456 BC')
+ # microsecs for BC timestamps look not available in PG < 8.4
+ # but more likely it's determined at compile time.
+ self.assert_(value in (
+ '0042-01-01 13:30:29.123456 BC',
+ '0042-01-01 13:30:29 BC'), value)
def test_adapt_timedelta(self):
from mx.DateTime import DateTimeDeltaFrom