#NEWLINE# def test_complete_auth_token( self ) : #NEWLINE# #INDENT# _state = 'state0' #NEWLINE# self . consumer . consumer_config [ 'response_type' ] = [ 'code' , 'token' ] #NEWLINE# args = { #NEWLINE# #INDENT# 'client_id' : self . consumer . client_id , #NEWLINE# 'response_type' : self . consumer . consumer_config [ 'response_type' ] , #NEWLINE# 'scope' : [ 'openid' ] , #NEWLINE# #UNINDENT# } #NEWLINE# result = self . consumer . do_authorization_request ( state = _state , request_args = args ) #NEWLINE# self . consumer . _backup ( 'state0' ) #NEWLINE# assert ( result . status_code == 302 ) #NEWLINE# parsed = urlparse ( result . headers [ 'location' ] ) #NEWLINE# baseurl = '{}://{}{}' . format ( parsed . scheme , parsed . netloc , parsed . path ) #NEWLINE# assert ( baseurl == self . consumer . redirect_uris [ 0 ] ) #NEWLINE# part = self . consumer . parse_authz ( query = parsed . query ) #NEWLINE# auth = part [ 0 ] #NEWLINE# acc = part [ 1 ] #NEWLINE# assert ( part [ 2 ] is None ) #NEWLINE# assert isinstance ( auth , AuthorizationResponse ) #NEWLINE# assert isinstance ( acc , AccessTokenResponse ) #NEWLINE# print ( auth . keys ( ) ) #NEWLINE# assert _eq ( auth . keys ( ) , [ 'code' , 'access_token' , 'token_type' , 'state' , 'client_id' , 'scope' ] ) #NEWLINE# assert _eq ( acc . keys ( ) , [ 'token_type' , 'state' , 'access_token' , 'scope' ] )