diff options
| author | Aymeric Augustin | 2013-10-17 21:30:15 +0200 |
|---|---|---|
| committer | Aymeric Augustin | 2013-10-17 21:30:15 +0200 |
| commit | 4d829c450327e015ee5d6919f6f5029079b7ebe0 (patch) | |
| tree | cada8a5dec45e5dd2a138bc47c33002eb7278d5a /tests/tests.py | |
| parent | daf14b5c363d4aef842d4a46eb1c6b603e5c10b7 (diff) | |
| download | django-debug-toolbar-4d829c450327e015ee5d6919f6f5029079b7ebe0.tar.bz2 | |
Support DEFAULT_CHARSET != 'utf-8'. Fix #15.
Diffstat (limited to 'tests/tests.py')
| -rw-r--r-- | tests/tests.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/tests.py b/tests/tests.py index 5390025..6883428 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -1,3 +1,5 @@ +# coding: utf-8 + from __future__ import unicode_literals import threading @@ -161,6 +163,19 @@ class DebugToolbarTestCase(BaseTestCase): self.assertEqual(stats['view_kwargs'], 'None') self.assertEqual(stats['view_func'], '<no view>') + def test_non_utf8_charset(self): + with self.settings(DEBUG=True, + DEFAULT_CHARSET='iso-8859-1', + INTERNAL_IPS=['127.0.0.1']): + + response = self.client.get('/regular/ASCII/') + self.assertContains(response, 'ASCII') # template + self.assertContains(response, 'djDebug') # toolbar + + response = self.client.get('/regular/LÀTÍN/') + self.assertContains(response, 'LÀTÍN') # template + self.assertContains(response, 'djDebug') # toolbar + class DebugToolbarNameFromObjectTest(BaseTestCase): def test_func(self): |
