#NEWLINE# def test_fetching_access_token_multiple_times( self ) : #NEWLINE# #INDENT# self . _login_authorize_get_token ( ) #NEWLINE# code = self . get_grant ( ) . code #NEWLINE# response = self . client . post ( self . access_token_url ( ) , { #NEWLINE# #INDENT# 'grant_type' : 'authorization_code' , #NEWLINE# 'client_id' : self . get_client ( ) . client_id , #NEWLINE# 'client_secret' : self . get_client ( ) . client_secret , #NEWLINE# 'code' : code , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 400 , response . status_code ) #NEWLINE# self . assertEqual ( 'invalid_grant' , json . loads ( response . content ) [ 'error' ] )