diff --git a/tests/regressiontests/requests/tests.py b/tests/regressiontests/requests/tests.py
index f9e1112..cb4ec53 100644
a
|
b
|
|
| 1 | # -*- encoding: utf-8 -*- |
1 | 2 | from __future__ import unicode_literals |
2 | 3 | |
3 | 4 | import time |
… |
… |
from django.core.handlers.wsgi import WSGIRequest, LimitedStream
|
10 | 11 | from django.http import HttpRequest, HttpResponse, parse_cookie, build_request_repr, UnreadablePostError |
11 | 12 | from django.test.utils import str_prefix |
12 | 13 | from django.utils import unittest |
13 | | from django.utils.http import cookie_date |
| 14 | from django.utils.http import cookie_date, urlencode |
14 | 15 | from django.utils.timezone import utc |
15 | 16 | |
16 | 17 | |
… |
… |
class RequestsTests(unittest.TestCase):
|
295 | 296 | self.assertRaises(Exception, lambda: request.body) |
296 | 297 | self.assertEqual(request.POST, {}) |
297 | 298 | |
| 299 | def test_non_ascii_POST(self): |
| 300 | payload = urlencode({'key': 'España'}).encode('utf-8') |
| 301 | request = WSGIRequest({ |
| 302 | 'REQUEST_METHOD': 'POST', |
| 303 | 'CONTENT_LENGTH': len(payload), |
| 304 | 'CONTENT_TYPE': 'application/x-www-form-urlencoded', |
| 305 | 'wsgi.input': BytesIO(payload) |
| 306 | }) |
| 307 | self.assertEqual(request.POST, {'key': ['España']}) |
| 308 | |
298 | 309 | def test_body_after_POST_multipart(self): |
299 | 310 | """ |
300 | 311 | Reading body after parsing multipart is not allowed |