diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2012-05-27 02:24:57 +0300 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2012-07-01 19:27:36 +0300 |
| commit | da573fbb4172fb962c9f021fc0c03cf91b13e746 (patch) | |
| tree | a8a6d9ef1d08eabae0e75863ef9f2bfa8f1facc1 /tests | |
| parent | bd283aa844b04651b7c8b4e85f48c6dced1678f0 (diff) | |
Fixed some locations to work with autocommit=True
- backends: supports_transactions()
- select_for_update tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/select_for_update/tests.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/modeltests/select_for_update/tests.py b/tests/modeltests/select_for_update/tests.py index 243f6b50e7..cb8f19f1e8 100644 --- a/tests/modeltests/select_for_update/tests.py +++ b/tests/modeltests/select_for_update/tests.py @@ -36,6 +36,8 @@ class SelectForUpdateTests(TransactionTestCase): # issuing a SELECT ... FOR UPDATE will block. new_connections = ConnectionHandler(settings.DATABASES) self.new_connection = new_connections[DEFAULT_DB_ALIAS] + self.new_connection.enter_transaction_management() + self.new_connection.managed(True) # We need to set settings.DEBUG to True so we can capture # the output SQL to examine. @@ -48,6 +50,7 @@ class SelectForUpdateTests(TransactionTestCase): # this in the course of their run. transaction.managed(False) transaction.leave_transaction_management() + self.new_connection.leave_transaction_management() except transaction.TransactionManagementError: pass self.new_connection.close() @@ -66,7 +69,7 @@ class SelectForUpdateTests(TransactionTestCase): 'for_update': self.new_connection.ops.for_update_sql(), } self.cursor.execute(sql, ()) - result = self.cursor.fetchone() + self.cursor.fetchone() def end_blocking_transaction(self): # Roll back the blocking transaction. |
