#NEWLINE# def test_is_authenticated_get_params( self ) : #NEWLINE# #INDENT# auth = ApiKeyAuthentication ( ) #NEWLINE# request = HttpRequest ( ) #NEWLINE# john_doe = User . objects . get ( username = 'johndoe' ) #NEWLINE# create_api_key ( User , instance = john_doe , created = True ) #NEWLINE# self . assertEqual ( isinstance ( auth . is_authenticated ( request ) , HttpUnauthorized ) , True ) #NEWLINE# request . GET [ 'username' ] = 'foo' #NEWLINE# self . assertEqual ( isinstance ( auth . is_authenticated ( request ) , HttpUnauthorized ) , True ) #NEWLINE# request . GET [ 'username' ] = 'daniel' #NEWLINE# self . assertEqual ( isinstance ( auth . is_authenticated ( request ) , HttpUnauthorized ) , True ) #NEWLINE# request . GET [ 'username' ] = 'daniel' #NEWLINE# request . GET [ 'api_key' ] = 'foo' #NEWLINE# self . assertEqual ( isinstance ( auth . is_authenticated ( request ) , HttpUnauthorized ) , True ) #NEWLINE# john_doe = User . objects . get ( username = 'johndoe' ) #NEWLINE# request . GET [ 'username' ] = 'johndoe' #NEWLINE# request . GET [ 'api_key' ] = john_doe . api_key . key #NEWLINE# self . assertEqual ( auth . is_authenticated ( request ) , True ) #NEWLINE# self . assertEqual ( auth . get_identifier ( self ) , 'johndoe' )