1
0
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:
Aymeric Augustin
2012-12-17 10:49:26 +01:00
parent d9a0b6ab36
commit 1e4a27d087
6 changed files with 49 additions and 19 deletions

View File

@@ -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)