def METHOD_NAME(self):
    http_entity = mock.MagicMock()
    headers = {}
    http_entity.headers = headers
    headers['content-type'] = 'foo/'
    self.assertFalse(is_text_payload(http_entity))
    headers['content-type'] = 'text/html; charset=utf-8'
    self.assertTrue(is_text_payload(http_entity))
    headers['content-type'] = 'APPLICATION/JSON; charset=utf-8'
    self.assertTrue(is_text_payload(http_entity))
    headers['content-type'] = 'APPLICATION/xml'
    self.assertTrue(is_text_payload(http_entity))
    http_entity.headers = None  # default to text mode if there is no header
    self.assertTrue(is_text_payload(http_entity))