aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tests.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-18 09:56:18 +0200
committerAymeric Augustin2013-10-18 09:56:18 +0200
commitf3a2e0b48d97b72cad9c79b48880f2a265be2e2d (patch)
tree93e7df3a37e133d5e86aa5f8d05c6f8f71f7887c /tests/tests.py
parent50e3714c6510fc12dc23aed41830b072d55332fe (diff)
downloaddjango-debug-toolbar-f3a2e0b48d97b72cad9c79b48880f2a265be2e2d.tar.bz2
Test that non-ASCII data in sessions works.
Fix #67.
Diffstat (limited to 'tests/tests.py')
-rw-r--r--tests/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tests.py b/tests/tests.py
index 6e0cd9b..1571800 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -26,6 +26,7 @@ rf = RequestFactory()
class BaseTestCase(TestCase):
+
def setUp(self):
request = rf.get('/')
response = HttpResponse()
@@ -40,6 +41,7 @@ class BaseTestCase(TestCase):
class DebugToolbarTestCase(BaseTestCase):
+
urls = 'tests.urls'
def test_middleware(self):
@@ -176,8 +178,16 @@ class DebugToolbarTestCase(BaseTestCase):
self.assertContains(response, 'LÀTÍN') # template
self.assertContains(response, 'djDebug') # toolbar
+ def test_non_ascii_session(self):
+ with self.settings(DEBUG=True, INTERNAL_IPS=['127.0.0.1']):
+ response = self.client.get('/set_session/')
+ self.assertContains(response, 'où')
+ if not six.PY3:
+ self.assertContains(response, 'là')
+
class DebugToolbarNameFromObjectTest(BaseTestCase):
+
def test_func(self):
def x():
return 1
@@ -196,6 +206,7 @@ class DebugToolbarNameFromObjectTest(BaseTestCase):
class SQLPanelTestCase(BaseTestCase):
+
def test_recording(self):
panel = self.toolbar.get_panel(SQLDebugPanel)
self.assertEqual(len(panel._queries), 0)
@@ -258,6 +269,7 @@ class SQLPanelTestCase(BaseTestCase):
class TemplatePanelTestCase(BaseTestCase):
+
def test_queryset_hook(self):
template_panel = self.toolbar.get_panel(TemplateDebugPanel)
sql_panel = self.toolbar.get_panel(SQLDebugPanel)