mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #12302: Modified force_unicode to avoid raising unicode errors when
handed exceptions with non-ASCII bytestring data and no working unicode method under Python 2.6 and higher. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12621 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
21
tests/regressiontests/debug/tests.py
Normal file
21
tests/regressiontests/debug/tests.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.test import TestCase
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from regressiontests.debug import BrokenException, except_args
|
||||
|
||||
class ExceptionTest(TestCase):
|
||||
urls = 'regressiontests.debug.urls'
|
||||
|
||||
def setUp(self):
|
||||
self.old_debug = settings.DEBUG
|
||||
settings.DEBUG = True
|
||||
|
||||
def tearDown(self):
|
||||
settings.DEBUG = self.old_debug
|
||||
|
||||
def test_view_exceptions(self):
|
||||
for n in range(len(except_args)):
|
||||
self.assertRaises(BrokenException, self.client.get,
|
||||
reverse('view_exception', args=(n,)))
|
||||
|
||||
Reference in New Issue
Block a user