From 4d829c450327e015ee5d6919f6f5029079b7ebe0 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 17 Oct 2013 21:30:15 +0200 Subject: Support DEFAULT_CHARSET != 'utf-8'. Fix #15. --- tests/tests.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/tests.py') 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'], '') + 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): -- cgit v1.2.3