'Generate an accept header value'

def _generate_header_accept(self):

    content_types = ['text/html', 'application/xhtml+xml', 'application/xml', 'text/plain']
    random.shuffle(content_types)
    header = []
    header.append(('%s,' % content_types.pop()))
    latest_quality = 9
    for r in range(0, random.randint(1, len(content_types))):
        header.append(('%s;0.%i,' % (content_types.pop(), latest_quality)))
        latest_quality = random.randint((latest_quality - 2), latest_quality)
    header.append('*/*')
    return ''.join(header)
