#NEWLINE# def testVaryHeaderDouble( self ) : #NEWLINE# #INDENT# uri = urllib . parse . urljoin ( base , 'vary/accept-double.asis' ) #NEWLINE# ( response , content ) = self . http . request ( uri , 'GET' , headers = { #NEWLINE# #INDENT# 'Accept' : 'text/plain' , #NEWLINE# 'Accept-Language' : 'da, en-gb;q=0.8, en;q=0.7' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . status , 200 ) #NEWLINE# self . assertTrue ( ( 'vary' in response ) ) #NEWLINE# ( response , content ) = self . http . request ( uri , 'GET' , headers = { #NEWLINE# #INDENT# 'Accept' : 'text/plain' , #NEWLINE# 'Accept-Language' : 'da, en-gb;q=0.8, en;q=0.7' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . fromcache , True , msg = 'Should be from cache' ) #NEWLINE# ( response , content ) = self . http . request ( uri , 'GET' , headers = { #NEWLINE# #INDENT# 'Accept' : 'text/plain' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . status , 200 ) #NEWLINE# self . assertEqual ( response . fromcache , False ) #NEWLINE# ( response , content ) = self . http . request ( uri , 'GET' , headers = { #NEWLINE# #INDENT# 'Accept-Language' : 'da' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . status , 200 ) #NEWLINE# self . assertEqual ( response . fromcache , False , msg = 'Should not be from cache' )