mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Ensure cursors are closed when no longer needed.
This commit touchs various parts of the code base and test framework. Any found usage of opening a cursor for the sake of initializing a connection has been replaced with 'ensure_connection()'.
This commit is contained in:
parent
0837eacc4e
commit
3ffeb93186
31 changed files with 657 additions and 615 deletions
|
@ -725,7 +725,7 @@ class DatabaseConnectionHandlingTests(TransactionTestCase):
|
|||
# request_finished signal.
|
||||
response = self.client.get('/')
|
||||
# Make sure there is an open connection
|
||||
connection.cursor()
|
||||
self.connection.ensure_connection()
|
||||
connection.enter_transaction_management()
|
||||
signals.request_finished.send(sender=response._handler_class)
|
||||
self.assertEqual(len(connection.transaction_state), 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue