Fixed #30193, Refs #28478 -- Avoided PostgreSQL connection health checks on initialization.

This addressed a regression introduced by a96b901932 as identified by Ran Benita.
This commit is contained in:
Simon Charette 2019-02-20 04:59:40 -05:00 committed by Carlton Gibson
parent edec11ce86
commit 7071f8f272
2 changed files with 7 additions and 4 deletions

View file

@ -134,6 +134,12 @@ class Tests(TestCase):
finally:
new_connection.close()
def test_connect_no_is_usable_checks(self):
new_connection = connection.copy()
with mock.patch.object(new_connection, 'is_usable') as is_usable:
new_connection.connect()
is_usable.assert_not_called()
def _select(self, val):
with connection.cursor() as cursor:
cursor.execute('SELECT %s', (val,))