mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
'encrypt_password' raises 'psycopg2.NotSupportedErorr' exception for
server version >= 10, when compiled using libpq version < 10, when no algorithm is specified.
This commit is contained in:
parent
2c1966a7f6
commit
e089d94c88
|
@ -1397,16 +1397,10 @@ class TransactionControlTests(ConnectingTestCase):
|
|||
)
|
||||
|
||||
if libpq_version() < 100000:
|
||||
if server_encryption_algorithm == 'md5':
|
||||
self.assertEqual(
|
||||
self.conn.encrypt_password('psycopg2', 'ashesh'),
|
||||
'md594839d658c28a357126f105b9cb14cfc'
|
||||
)
|
||||
else:
|
||||
self.assertRaises(
|
||||
psycopg2.NotSupportedError,
|
||||
self.conn.encrypt_password, 'psycopg2', 'ashesh'
|
||||
)
|
||||
self.assertRaises(
|
||||
psycopg2.NotSupportedError,
|
||||
self.conn.encrypt_password, 'psycopg2', 'ashesh'
|
||||
)
|
||||
else:
|
||||
enc_password = self.conn.encrypt_password('psycopg2', 'ashesh')
|
||||
if server_encryption_algorithm == 'md5':
|
||||
|
|
Loading…
Reference in New Issue
Block a user