mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Fixed parse_dsn tests on Python 3
On Python 3 there is no Exception.message attribute.
This commit is contained in:
parent
d3bbd19ccb
commit
71d96293ab
|
@ -333,7 +333,7 @@ class ParseDsnTestCase(ConnectingTestCase):
|
|||
parse_dsn("dbname='test 2 user=tester password=secret")
|
||||
except ProgrammingError, e:
|
||||
raised = True
|
||||
self.assertTrue(e.message.find('secret') < 0,
|
||||
self.assertTrue(str(e).find('secret') < 0,
|
||||
"DSN was not exposed in error message")
|
||||
except e:
|
||||
self.fail("unexpected error condition: " + repr(e))
|
||||
|
@ -354,7 +354,7 @@ class ParseDsnTestCase(ConnectingTestCase):
|
|||
parse_dsn('postgresql://tester:secret@/test?port=1111=x')
|
||||
except ProgrammingError, e:
|
||||
raised = True
|
||||
self.assertTrue(e.message.find('secret') < 0,
|
||||
self.assertTrue(str(e).find('secret') < 0,
|
||||
"URI was not exposed in error message")
|
||||
except e:
|
||||
self.fail("unexpected error condition: " + repr(e))
|
||||
|
|
Loading…
Reference in New Issue
Block a user