

def test_POST_a_parameter(self):
    wsgi_input_mock = MagicMock()
    wsgi_input_mock.read.return_value = b'key1=value1'
    request = Request({
        'REQUEST_METHOD': 'POST',
        'QUERY_STRING': '',
        'wsgi.input': wsgi_input_mock,
        'CONTENT_TYPE': 'application/x-www-form-urlencoded',
        'CONTENT_LENGTH': len(b'key1=value1'),
    })
    self.assertEqual(request.POST['key1'], 'value1')

dataset/ETHPy150Open c-bata/kobin/tests/test_environs.py RequestTests.test_POST_a_parameter/original