diff options
Diffstat (limited to 'tests/commands/test_debugsqlshell.py')
| -rw-r--r-- | tests/commands/test_debugsqlshell.py | 11 | 
1 files changed, 7 insertions, 4 deletions
| diff --git a/tests/commands/test_debugsqlshell.py b/tests/commands/test_debugsqlshell.py index f0c88fa..f10a629 100644 --- a/tests/commands/test_debugsqlshell.py +++ b/tests/commands/test_debugsqlshell.py @@ -4,7 +4,10 @@ import sys  from django.contrib.auth.models import User  from django.core import management -from django.db.backends import util +try: +    from django.db.backends import utils +except ImportError: +    from django.db.backends import util as utils  from django.test import TestCase  from django.test.utils import override_settings  from django.utils import six @@ -14,8 +17,8 @@ from django.utils import six  class DebugSQLShellTestCase(TestCase):      def setUp(self): -        self.original_cursor_wrapper = util.CursorDebugWrapper -        # Since debugsqlshell monkey-patches django.db.backends.util, we can +        self.original_cursor_wrapper = utils.CursorDebugWrapper +        # Since debugsqlshell monkey-patches django.db.backends.utils, we can          # test it simply by loading it, without executing it. But we have to          # undo the monkey-patch on exit.          command_name = 'debugsqlshell' @@ -23,7 +26,7 @@ class DebugSQLShellTestCase(TestCase):          management.load_command_class(app_name, command_name)      def tearDown(self): -        util.CursorDebugWrapper = self.original_cursor_wrapper +        utils.CursorDebugWrapper = self.original_cursor_wrapper      def test_command(self):          original_stdout, sys.stdout = sys.stdout, six.StringIO() | 
