'Build a Zendesk ticket update that can be used in assertions to verify that the correct
data was submitted to update a Zendesk ticket.'

def _build_zendesk_ticket_update(self, request_headers, username=None):

    body = []
    if username:
        body.append('username:    {}'.format(username))
    header_text_mapping = [('Client    IP', 'REMOTE_ADDR'), ('Host', 'SERVER_NAME'), ('Page', 'HTTP_REFERER'), ('Browser', 'HTTP_USER_AGENT')]
    for (text, header) in header_text_mapping:
        body.append('{}:    {}'.format(text, request_headers[header]))
    body = ('Additional    information:\n\n' + '\n'.join(body))
    return {'ticket': {'comment': {'public': False, 'body': body}}}
