Refs #31233 -- Changed DatabaseWrapper._nodb_connection to _nodb_cursor().

It is now a method instead of a property and returns a context manager
that yields a cursor on entry and closes the cursor and connection upon
exit.
This commit is contained in:
Jon Dufresne 2020-02-03 19:07:00 -08:00 committed by Mariusz Felisiak
parent 2d55cb5c4a
commit f48f671223
8 changed files with 58 additions and 34 deletions

View file

@ -38,4 +38,5 @@ class OIDTests(PostgreSQLTestCase):
def test_register_type_handlers_no_db(self):
"""Registering type handlers for the nodb connection does nothing."""
register_type_handlers(connection._nodb_connection)
with connection._nodb_cursor() as cursor:
register_type_handlers(cursor.db)