mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #19468 -- Decoded request.path correctly on Python 3.
Thanks aliva for the report and claudep for the feedback.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django.core.handlers.wsgi import WSGIHandler
|
||||
from django.test import RequestFactory
|
||||
from django.test.utils import override_settings
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
|
||||
class HandlerTests(unittest.TestCase):
|
||||
@@ -22,7 +23,7 @@ class HandlerTests(unittest.TestCase):
|
||||
def test_bad_path_info(self):
|
||||
"""Tests for bug #15672 ('request' referenced before assignment)"""
|
||||
environ = RequestFactory().get('/').environ
|
||||
environ['PATH_INFO'] = b'\xed'
|
||||
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