diff options
| author | Aymeric Augustin | 2014-01-08 21:55:17 +0100 | 
|---|---|---|
| committer | Aymeric Augustin | 2014-01-08 22:13:32 +0100 | 
| commit | fe6b2ce8c3db95367741012dce6a310cdd50266e (patch) | |
| tree | 0ec77a164cf2831a237573d3d212166d8f4c2ff0 /tests/commands/test_debugsqlshell.py | |
| parent | c4224327f5e855d472d6f07316f374d209238411 (diff) | |
| download | django-debug-toolbar-fe6b2ce8c3db95367741012dce6a310cdd50266e.tar.bz2 | |
Allow the tests to run on Django 1.7.
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() | 
