summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2017-08-16 18:39:58 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2017-08-16 18:42:41 +0200
commit07e34f8bca83704e4c3d50830574a839354d9bcc (patch)
treeeff0446ecfccc8520d82111f5412a1e9020b1477 /django
parent1214e7c1b1248a7e51dfbdaaaed5bca56956f218 (diff)
[1.11.x] Fixed #28498 -- Fixed test database creation with cx_Oracle 6.
Backport of 6784383e93d582f43f8cb5f7647a05645cbb339b from master
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/oracle/creation.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/backends/oracle/creation.py b/django/db/backends/oracle/creation.py
index d34f2a2d50..911f19b50e 100644
--- a/django/db/backends/oracle/creation.py
+++ b/django/db/backends/oracle/creation.py
@@ -96,6 +96,8 @@ class DatabaseCreation(BaseDatabaseCreation):
print("Tests cancelled.")
sys.exit(1)
+ # Cursor must be closed before closing connection.
+ cursor.close()
self._maindb_connection.close() # done with main user -- test user and tablespaces created
self._switch_to_test_user(parameters)
return self.connection.settings_dict['NAME']
@@ -180,6 +182,8 @@ class DatabaseCreation(BaseDatabaseCreation):
if verbosity >= 1:
print('Destroying test database tables...')
self._execute_test_db_destruction(cursor, parameters, verbosity)
+ # Cursor must be closed before closing connection.
+ cursor.close()
self._maindb_connection.close()
def _execute_test_db_creation(self, cursor, parameters, verbosity, keepdb=False):