Fixed test_dates failures in older version of Python

This commit is contained in:
Federico Di Gregorio 2009-04-01 20:52:58 +02:00
parent e8ef973ddf
commit 8e54f7dcce
3 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,8 @@
2009-04-01 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>

View File

@ -153,5 +153,4 @@
<File name="psycopg/adapter_pfloat.h" subtype="Code" buildaction="Nothing" />
</Contents>
<compiler ctype="GccCompiler" />
<MonoDevelop.ChangeLogAddIn.ChangeLogInfo policy="UpdateNearestChangeLog" />
</Project>

View File

@ -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")