summaryrefslogtreecommitdiff
path: root/tests/backends/postgresql/tests.py
diff options
context:
space:
mode:
authorSimon Charette <charettes@users.noreply.github.com>2019-02-20 04:59:40 -0500
committerCarlton Gibson <carlton.gibson@noumenal.es>2019-02-20 10:59:40 +0100
commit7071f8f2729295b0da77b6c651966dc32c71f1ab (patch)
tree9e9c46abec3a2b6b1dbc698c37c483d43785b6c6 /tests/backends/postgresql/tests.py
parentedec11ce86a1a0d9e4c5a2a0df6acaf655041c24 (diff)
Fixed #30193, Refs #28478 -- Avoided PostgreSQL connection health checks on initialization.
This addressed a regression introduced by a96b9019320ed8236659ee520a7a017c1bafbc6f as identified by Ran Benita.
Diffstat (limited to 'tests/backends/postgresql/tests.py')
-rw-r--r--tests/backends/postgresql/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/backends/postgresql/tests.py b/tests/backends/postgresql/tests.py
index 6fd0ba4420..96a1501693 100644
--- a/tests/backends/postgresql/tests.py
+++ b/tests/backends/postgresql/tests.py
@@ -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,))