def test_HeaderAccept_to_http(): """Assert value.to_http() returns expected string value""" accept_html = MediaRange(mimetype='text/html') accept_xml = MediaRange(mimetype='application/xml', q='0.9') accept_text = MediaRange( mimetype='text/plain', level='1', version='1.0' ) expected = 'text/html,text/plain;level=1;version=1.0,application/xml;q=0.9' accepts = HeaderAccept([accept_html, accept_xml, accept_text]) assert accepts.to_http() == expected