Commit 9bdfe176 authored by Karen Tracey's avatar Karen Tracey
Browse files

[1.1.X] Move the tests added for #12302 to where some other tests for debug...

[1.1.X] Move the tests added for #12302 to where some other tests for debug page responses already existed. 

r12723 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 55c71d3e
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
# -*- coding: utf8 -*-

class BrokenException(Exception):
    pass

except_args = ('Broken!',           # plain exception with ASCII text
               u'¡Broken!',         # non-ASCII unicode data
               '¡Broken!',          # non-ASCII, utf-8 encoded bytestring
               '\xa1Broken!', )     # non-ASCII, latin1 bytestring
+0 −0

Empty file deleted.

+0 −21
Original line number Diff line number Diff line
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,)))
+0 −5
Original line number Diff line number Diff line
from django.conf.urls.defaults import *

urlpatterns = patterns('regressiontests.debug.views',
    url(r'view_exception/(?P<n>\d+)/$', 'view_exception', name='view_exception'),
)
+0 −5
Original line number Diff line number Diff line
from regressiontests.debug import BrokenException, except_args

def view_exception(request, n):
    raise BrokenException(except_args[int(n)])
Loading