#NEWLINE# def test_invalid_handler( self ) : #NEWLINE# #INDENT# request = self . factory . get ( '/' ) #NEWLINE# request . META [ 'HTTP_AUTHORIZATION' ] = 'type token' #NEWLINE# try : #NEWLINE# #INDENT# AuthenticationMiddleware ( ) . process_request ( request ) #NEWLINE# self . fail ( 'Request was not rejected' ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# pass