aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debug_toolbar/management/commands/debugsqlshell.py2
-rw-r--r--tests/tests.py9
2 files changed, 11 insertions, 0 deletions
diff --git a/debug_toolbar/management/commands/debugsqlshell.py b/debug_toolbar/management/commands/debugsqlshell.py
index c5718b8..120f0a2 100644
--- a/debug_toolbar/management/commands/debugsqlshell.py
+++ b/debug_toolbar/management/commands/debugsqlshell.py
@@ -2,6 +2,8 @@ from __future__ import print_function, unicode_literals
from time import time
+# 'debugsqlshell' is the same as the 'shell'.
+from django.core.management.commands.shell import Command
from django.db.backends import util
import sqlparse
diff --git a/tests/tests.py b/tests/tests.py
index e015b6e..c430d5c 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -9,6 +9,7 @@ from xml.etree import ElementTree as ET
import django
from django.conf import settings
from django.contrib.auth.models import User
+from django.core import management
from django.db import connection, IntegrityError
from django.http import HttpResponse
from django.test import TestCase, RequestFactory
@@ -342,3 +343,11 @@ class LoggingPanelTestCase(BaseTestCase):
self.assertEqual(1, len(records))
self.assertEqual(MESSAGE_IF_STRING_REPRESENTATION_INVALID,
records[0]['message'])
+
+
+class DebugSQLShellTestCase(TestCase):
+
+ def test_command_exists(self):
+ command_name = 'debugsqlshell'
+ app_name = management.get_commands()[command_name]
+ management.load_command_class(app_name, command_name)