mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #15672 -- Refined changes made in r15918. Thanks, vung.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16082 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from django.utils import unittest
|
||||
from django.conf import settings
|
||||
from django.core.handlers.wsgi import WSGIHandler
|
||||
from django.test import RequestFactory
|
||||
|
||||
|
||||
class HandlerTests(unittest.TestCase):
|
||||
|
||||
@@ -23,3 +25,10 @@ class HandlerTests(unittest.TestCase):
|
||||
# Reset settings
|
||||
settings.MIDDLEWARE_CLASSES = old_middleware_classes
|
||||
|
||||
def test_bad_path_info(self):
|
||||
"""Tests for bug #15672 ('request' referenced before assignment)"""
|
||||
environ = RequestFactory().get('/').environ
|
||||
environ['PATH_INFO'] = '\xed'
|
||||
handler = WSGIHandler()
|
||||
response = handler(environ, lambda *a, **k: None)
|
||||
self.assertEqual(response.status_code, 400)
|
||||
|
||||
Reference in New Issue
Block a user