#NEWLINE# def test_content_types( self ) : #NEWLINE# #INDENT# environ = { #NEWLINE# #INDENT# 'HTTP_ACCEPT' : 'text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8' , #NEWLINE# #UNINDENT# } #NEWLINE# a = WsgiRequest ( environ ) #NEWLINE# content_types = a . content_types #NEWLINE# self . assertTrue ( environ ) #NEWLINE# self . assertEqual ( len ( content_types ) , 4 ) #NEWLINE# self . assertEqual ( id ( content_types ) , id ( a . content_types ) ) #NEWLINE# self . assertTrue ( ( 'text/html' in content_types ) ) #NEWLINE# self . assertTrue ( ( 'text/plain' in content_types ) ) #NEWLINE# self . assertEqual ( content_types . quality ( 'text/html' ) , 1 ) #NEWLINE# self . assertEqual ( content_types . quality ( 'text/plain' ) , 0.8 ) #NEWLINE# self . assertEqual ( content_types . quality ( 'application/json' ) , 0.8 ) #NEWLINE# self . assertEqual ( content_types . best , 'text/html' )