From 8e54f7dcce45ff268ee9d3bb4368b8858d7d43cd Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Wed, 1 Apr 2009 20:52:58 +0200 Subject: [PATCH] Fixed test_dates failures in older version of Python --- ChangeLog | 3 +++ psycopg2.mdp | 1 - tests/test_dates.py | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e547ebb7..ec86c3d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-04-01 Federico Di Gregorio + * Applied patch from Menno Smits to fix failures in test_dates + when executed in older version of Python. + * Applied patch from Menno Smits to fix lobject test failures. 2009-03-08 Federico Di Gregorio diff --git a/psycopg2.mdp b/psycopg2.mdp index 4f90bcfd..219809f8 100644 --- a/psycopg2.mdp +++ b/psycopg2.mdp @@ -153,5 +153,4 @@ - \ No newline at end of file diff --git a/tests/test_dates.py b/tests/test_dates.py index 7b9e59fe..0a02a119 100644 --- a/tests/test_dates.py +++ b/tests/test_dates.py @@ -131,7 +131,7 @@ class DatetimeTests(unittest.TestCase, CommonDatetimeTestsMixin): try: self.check_time_tz("+01:15:42", 4542) except ValueError, exc: - self.assertEqual(exc.message, "time zone offset 4542 is not a " + self.assertEqual(str(exc), "time zone offset 4542 is not a " "whole number of minutes") else: self.fail("Expected ValueError") @@ -139,7 +139,7 @@ class DatetimeTests(unittest.TestCase, CommonDatetimeTestsMixin): try: self.check_time_tz("-01:15:42", -4542) except ValueError, exc: - self.assertEqual(exc.message, "time zone offset -4542 is not a " + self.assertEqual(str(exc), "time zone offset -4542 is not a " "whole number of minutes") else: self.fail("Expected ValueError") @@ -175,7 +175,7 @@ class DatetimeTests(unittest.TestCase, CommonDatetimeTestsMixin): try: self.check_datetime_tz("+01:15:42", 4542) except ValueError, exc: - self.assertEqual(exc.message, "time zone offset 4542 is not a " + self.assertEqual(str(exc), "time zone offset 4542 is not a " "whole number of minutes") else: self.fail("Expected ValueError") @@ -183,7 +183,7 @@ class DatetimeTests(unittest.TestCase, CommonDatetimeTestsMixin): try: self.check_datetime_tz("-01:15:42", -4542) except ValueError, exc: - self.assertEqual(exc.message, "time zone offset -4542 is not a " + self.assertEqual(str(exc), "time zone offset -4542 is not a " "whole number of minutes") else: self.fail("Expected ValueError")