diff options
| author | Bouke Haarsma <bouke@webatoom.nl> | 2013-10-14 15:14:17 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-10-21 11:31:05 -0400 |
| commit | 3565efaa451db6eb735a085ea6aae3fe86e6d283 (patch) | |
| tree | 7030dcebfb01ef75bd1d6b308fd21caea3f20034 /tests/select_for_update | |
| parent | 499cd912ca36597df737df73c8f91ffab36c83d9 (diff) | |
| download | django-3565efaa451db6eb735a085ea6aae3fe86e6d283.tar.gz | |
Removed some direct settings manipulations in tests; refs #21230.
Diffstat (limited to 'tests/select_for_update')
| -rw-r--r-- | tests/select_for_update/tests.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/select_for_update/tests.py b/tests/select_for_update/tests.py index b95a56fe4b..7147c97dcc 100644 --- a/tests/select_for_update/tests.py +++ b/tests/select_for_update/tests.py @@ -9,6 +9,7 @@ from django.db import transaction, connection, router from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature) +from django.test.utils import override_settings from multiple_database.routers import TestRouter @@ -23,6 +24,9 @@ except ImportError: requires_threading = unittest.skipUnless(threading, 'requires threading') +# We need to set settings.DEBUG to True so we can capture the output SQL +# to examine. +@override_settings(DEBUG=True) class SelectForUpdateTests(TransactionTestCase): available_apps = ['select_for_update'] @@ -41,11 +45,6 @@ class SelectForUpdateTests(TransactionTestCase): self.new_connection = new_connections[DEFAULT_DB_ALIAS] self.new_connection.enter_transaction_management() - # We need to set settings.DEBUG to True so we can capture - # the output SQL to examine. - self._old_debug = settings.DEBUG - settings.DEBUG = True - def tearDown(self): try: # We don't really care if this fails - some of the tests will set @@ -55,7 +54,6 @@ class SelectForUpdateTests(TransactionTestCase): except transaction.TransactionManagementError: pass self.new_connection.close() - settings.DEBUG = self._old_debug try: self.end_blocking_transaction() except (DatabaseError, AttributeError): |
