Ejemplo n.º 1
0
 def test_set_encoding_clears_GET(self):
     request = WSGIRequest({
         'REQUEST_METHOD': 'GET',
         'wsgi.input': '',
         'QUERY_STRING': 'name=Hello%20G%C3%BCnter',
     })
     self.assertEqual(request.GET, {'name': ['Hello Günter']})
     request.encoding = 'iso-8859-16'
     self.assertEqual(request.GET, {'name': ['Hello G\u0102\u0152nter']})
Ejemplo n.º 2
0
 def test_set_encoding_clears_GET(self):
     request = WSGIRequest({
         'REQUEST_METHOD': 'GET',
         'wsgi.input': '',
         'QUERY_STRING': 'name=Hello%20G%C3%BCnter',
     })
     self.assertEqual(request.GET, {'name': ['Hello Günter']})
     request.encoding = 'iso-8859-16'
     self.assertEqual(request.GET, {'name': ['Hello G\u0102\u0152nter']})
Ejemplo n.º 3
0
 def test_set_encoding_clears_GET(self):
     request = WSGIRequest({
         "REQUEST_METHOD": "GET",
         "wsgi.input": "",
         "QUERY_STRING": "name=Hello%20G%C3%BCnter",
     })
     self.assertEqual(request.GET, {"name": ["Hello Günter"]})
     request.encoding = "iso-8859-16"
     self.assertEqual(request.GET, {"name": ["Hello G\u0102\u0152nter"]})
Ejemplo n.º 4
0
 def test_set_encoding_clears_POST(self):
     payload = FakePayload('name=Hello Günter')
     request = WSGIRequest({
         'REQUEST_METHOD': 'POST',
         'CONTENT_TYPE': 'application/x-www-form-urlencoded',
         'CONTENT_LENGTH': len(payload),
         'wsgi.input': payload,
     })
     self.assertEqual(request.POST, {'name': ['Hello Günter']})
     request.encoding = 'iso-8859-16'
     self.assertEqual(request.POST, {'name': ['Hello GĂŒnter']})
Ejemplo n.º 5
0
 def test_set_encoding_clears_POST(self):
     payload = FakePayload('name=Hello Günter')
     request = WSGIRequest({
         'REQUEST_METHOD': 'POST',
         'CONTENT_TYPE': 'application/x-www-form-urlencoded',
         'CONTENT_LENGTH': len(payload),
         'wsgi.input': payload,
     })
     self.assertEqual(request.POST, {'name': ['Hello Günter']})
     request.encoding = 'iso-8859-16'
     self.assertEqual(request.POST, {'name': ['Hello GĂŒnter']})
Ejemplo n.º 6
0
 def test_set_encoding_clears_POST(self):
     payload = FakePayload("name=Hello Günter")
     request = WSGIRequest({
         "REQUEST_METHOD": "POST",
         "CONTENT_TYPE": "application/x-www-form-urlencoded",
         "CONTENT_LENGTH": len(payload),
         "wsgi.input": payload,
     })
     self.assertEqual(request.POST, {"name": ["Hello Günter"]})
     request.encoding = "iso-8859-16"
     self.assertEqual(request.POST, {"name": ["Hello GĂŒnter"]})