summaryrefslogtreecommitdiff
path: root/tests/select_for_update
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2017-08-16 18:39:58 +0200
committerGitHub <noreply@github.com>2017-08-16 18:39:58 +0200
commit6784383e93d582f43f8cb5f7647a05645cbb339b (patch)
treec1acb12139023af9e0962751b0d7470e318f3af9 /tests/select_for_update
parenta4934243527c18775c70e998bec2fd87235853ac (diff)
downloaddjango-6784383e93d582f43f8cb5f7647a05645cbb339b.tar.gz
Fixed #28498 -- Fixed test database creation with cx_Oracle 6.
Diffstat (limited to 'tests/select_for_update')
-rw-r--r--tests/select_for_update/tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/select_for_update/tests.py b/tests/select_for_update/tests.py
index eaedd506de..707fa0e9ba 100644
--- a/tests/select_for_update/tests.py
+++ b/tests/select_for_update/tests.py
@@ -56,6 +56,7 @@ class SelectForUpdateTests(TransactionTestCase):
def end_blocking_transaction(self):
# Roll back the blocking transaction.
+ self.cursor.close()
self.new_connection.rollback()
self.new_connection.set_autocommit(True)
@@ -370,7 +371,10 @@ class SelectForUpdateTests(TransactionTestCase):
finally:
# This method is run in a separate thread. It uses its own
# database connection. Close it without waiting for the GC.
- connection.close()
+ # Connection cannot be closed on Oracle because cursor is still
+ # open.
+ if connection.vendor != 'oracle':
+ connection.close()
status = []
thread = threading.Thread(target=raw, kwargs={'status': status})