aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tests.py
diff options
context:
space:
mode:
authorDavid Cramer2011-06-14 12:49:51 -0700
committerDavid Cramer2011-06-14 12:49:51 -0700
commit7504141f19ef1bdaaf91d95461dad35ac84b5211 (patch)
treee3a110296b02b1f665b0563f9ecfa244ebc8e0b4 /tests/tests.py
parent4ee67a1632f41a873d997ae15ac0a2eccca04430 (diff)
parent2480ca97297a101b91e6287e9bd5acd4547e6bbd (diff)
downloaddjango-debug-toolbar-7504141f19ef1bdaaf91d95461dad35ac84b5211.tar.bz2
Merge branch 'master' of github.com:django-debug-toolbar/django-debug-toolbar
Diffstat (limited to 'tests/tests.py')
-rw-r--r--tests/tests.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/tests.py b/tests/tests.py
index 31b96c8..84b4418 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -1,5 +1,6 @@
from debug_toolbar.middleware import DebugToolbarMiddleware
from debug_toolbar.panels.sql import SQLDebugPanel
+from debug_toolbar.panels.request_vars import RequestVarsDebugPanel
from debug_toolbar.toolbar.loader import DebugToolbar
from debug_toolbar.utils.tracking import pre_dispatch, post_dispatch, callbacks
@@ -133,6 +134,28 @@ class DebugToolbarTestCase(BaseTestCase):
self.assertEquals(request.urlconf.urlpatterns[0]._callback_str, 'debug_toolbar.views.debug_media')
self.assertEquals(request.urlconf.urlpatterns[-1].urlconf_name.__name__, 'tests.urls')
+ def test_with_process_view(self):
+ request = self.request
+
+ def _test_view(request):
+ return HttpResponse('')
+
+ with Settings(DEBUG=True):
+ panel = self.toolbar.get_panel(RequestVarsDebugPanel)
+ panel.process_request(request)
+ panel.process_view(request, _test_view, [], {})
+ content = panel.content()
+ self.assertIn('debug_toolbar.tests.tests._test_view', content)
+
+ def test_without_process_view(self):
+ request = self.request
+
+ with Settings(DEBUG=True):
+ panel = self.toolbar.get_panel(RequestVarsDebugPanel)
+ panel.process_request(request)
+ content = panel.content()
+ self.assertIn('<no view>', content)
+
class SQLPanelTestCase(BaseTestCase):
def test_recording(self):
panel = self.toolbar.get_panel(SQLDebugPanel)
@@ -281,4 +304,4 @@ class TrackingTestCase(BaseTestCase):
self.assertTrue('kwargs' in foo, foo)
self.assertTrue(len(foo['kwargs']), 1)
self.assertTrue('foo' in foo['kwargs'])
- self.assertEquals(foo['kwargs']['foo'], 'bar') \ No newline at end of file
+ self.assertEquals(foo['kwargs']['foo'], 'bar')