#NEWLINE# def test_update_headers( self ) : #NEWLINE# #INDENT# ( defaults , spider , mw ) = self . get_defaults_spider_mw ( ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'Accept-Language' : [ 'es' ] , #NEWLINE# 'Test-Header' : [ 'test' ] , #NEWLINE# #UNINDENT# } #NEWLINE# bytes_headers = { #NEWLINE# #INDENT# b'Accept-Language' : [ b'es' ] , #NEWLINE# b'Test-Header' : [ b'test' ] , #NEWLINE# #UNINDENT# } #NEWLINE# req = Request ( 'http://www.scrapytest.org' , headers = headers ) #NEWLINE# self . assertEquals ( req . headers , bytes_headers ) #NEWLINE# mw . process_request ( req , spider ) #NEWLINE# defaults . update ( spider ) #NEWLINE# self . assertEquals ( req . headers , defaults )