aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/commands/test_debugsqlshell.py11
-rw-r--r--tests/panels/test_logging.py4
-rw-r--r--tests/settings.py2
3 files changed, 12 insertions, 5 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()
diff --git a/tests/panels/test_logging.py b/tests/panels/test_logging.py
index 342e673..288efad 100644
--- a/tests/panels/test_logging.py
+++ b/tests/panels/test_logging.py
@@ -2,7 +2,8 @@ from __future__ import absolute_import, unicode_literals
import logging
-from debug_toolbar.panels.logging import MESSAGE_IF_STRING_REPRESENTATION_INVALID
+from debug_toolbar.panels.logging import (
+ collector, MESSAGE_IF_STRING_REPRESENTATION_INVALID)
from ..base import BaseTestCase
@@ -13,6 +14,7 @@ class LoggingPanelTestCase(BaseTestCase):
super(LoggingPanelTestCase, self).setUp()
self.panel = self.toolbar.get_panel_by_id('LoggingPanel')
self.logger = logging.getLogger(__name__)
+ collector.clear_collection()
def test_happy_case(self):
self.logger.info('Nothing to see here, move along!')
diff --git a/tests/settings.py b/tests/settings.py
index 70049b4..0a4094d 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -40,6 +40,8 @@ MIDDLEWARE_CLASSES = [
ROOT_URLCONF = 'tests.urls'
+STATIC_ROOT = os.path.join(BASE_DIR, 'tests', 'static')
+
STATIC_URL = '/static/'
STATICFILES_DIRS = [