'Tests POSTing files using multipart form data and multiple messages,
with no body in the initial message.'

def test_post_files(self):

    body = (((((('--BOUNDARY\r\n' + 'Content-Disposition:    form-data;    name="title"\r\n\r\n') + 'My    First    Book\r\n') + '--BOUNDARY\r\n') + 'Content-Disposition:    form-data;    name="pdf";    filename="book.pdf"\r\n\r\n') + 'FAKEPDFBYTESGOHERE') + '--BOUNDARY--')
    Channel(u'test').send({u'reply_channel': u'test', u'http_version': u'1.1', u'method': u'POST', u'path': u'/test/', u'body_channel': u'test-input', u'headers': {u'content-type': 'multipart/form-data;    boundary=BOUNDARY', u'content-length': six.text_type(len(body)).encode(u'ascii')}}, immediately=True)
    Channel(u'test-input').send({u'content': body[:20], u'more_content': True}, immediately=True)
    Channel(u'test-input').send({u'content': body[20:]}, immediately=True)
    request = AsgiRequest(self.get_next_message(u'test'))
    self.assertEqual(request.method, u'POST')
    self.assertEqual(len(request.body), len(body))
    self.assertTrue(request.META[u'CONTENT_TYPE'].startswith(u'multipart/form-data'))
    self.assertFalse(request._post_parse_error)
    self.assertEqual(request.POST[u'title'], u'My    First    Book')
    self.assertEqual(request.FILES[u'pdf'].read(), 'FAKEPDFBYTESGOHERE')
