'Tests a POST body contained within a single message.'

def test_post_single(self):

    Channel(u'test').send({u'reply_channel': u'test', u'http_version': u'1.1', u'method': u'POST', u'path': u'/test2/', u'query_string': u'django=great', u'body': 'ponies=are+awesome', u'headers': {u'host': 'example.com', u'content-type': 'application/x-www-form-urlencoded', u'content-length': '18'}}, immediately=True)
    request = AsgiRequest(self.get_next_message(u'test'))
    self.assertEqual(request.path, u'/test2/')
    self.assertEqual(request.method, u'POST')
    self.assertEqual(request.body, 'ponies=are+awesome')
    self.assertEqual(request.META[u'HTTP_HOST'], u'example.com')
    self.assertEqual(request.META[u'CONTENT_TYPE'], u'application/x-www-form-urlencoded')
    self.assertEqual(request.GET[u'django'], u'great')
    self.assertEqual(request.POST[u'ponies'], u'are    awesome')
    with self.assertRaises(KeyError):
        request.POST[u'django']
    with self.assertRaises(KeyError):
        request.GET[u'ponies']
