def METHOD_NAME(self, mock):
    # thanks to https://stackoverflow.com/a/29905620
    @asyncio.coroutine
    def create(file_name, pages, object_name, s3_helper):
        with open(file_name, "w") as file:
            file.write("The pdf file")
    mock.side_effect = create
    resp = self.testapp.post("/en/report/create/32", status=200)
    self.assertEqual(resp.body.decode(), 'The pdf file')
    self.assertEqual(resp.content_type, 'application/pdf')