#NEWLINE# def test_userinfo( self ) : #NEWLINE# #INDENT# _state = 'state0' #NEWLINE# args = { #NEWLINE# #INDENT# 'client_id' : self . consumer . client_id , #NEWLINE# 'response_type' : 'code' , #NEWLINE# 'scope' : [ 'openid' ] , #NEWLINE# #UNINDENT# } #NEWLINE# result = self . consumer . do_authorization_request ( state = _state , request_args = args ) #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# self . consumer . parse_response ( AuthorizationResponse , info = parsed . query , sformat = 'urlencoded' ) #NEWLINE# self . consumer . complete ( _state ) #NEWLINE# result = self . consumer . get_user_info ( _state ) #NEWLINE# assert isinstance ( result , OpenIDSchema ) #NEWLINE# assert _eq ( result . keys ( ) , [ 'name' , 'email' , 'verified' , 'nickname' , 'sub' ] )