#NEWLINE# def test_get_token( self ) : #NEWLINE# #INDENT# rv = self . client . post ( '/oauth/token' , data = { #NEWLINE# #INDENT# 'grant_type' : 'password' , #NEWLINE# 'username' : 'foo' , #NEWLINE# 'password' : 'right' , #NEWLINE# 'client_id' : self . oauth_client . client_id , #NEWLINE# 'client_secret' : rv . oauth_client . client_secret , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( b'access_token' in rv . data ) #NEWLINE# auth = 'cGFzcy1jbGllbnQ6cGFzcy1zZWNyZXQ=' #NEWLINE# rv = self . client . post ( '/oauth/token' , data = { #NEWLINE# #INDENT# 'grant_type' : 'password' , #NEWLINE# 'username' : 'foo' , #NEWLINE# 'password' : 'right' , #NEWLINE# #UNINDENT# } , headers = { #NEWLINE# #INDENT# 'Authorization' : ( 'Basic %s' % auth ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( b'access_token' in rv . data )