#NEWLINE# def test_password_grant_public( self ) : #NEWLINE# #INDENT# c = self . get_client ( ) #NEWLINE# c . client_type = 1 #NEWLINE# c . save ( ) #NEWLINE# response = self . client . post ( self . access_token_url ( ) , { #NEWLINE# #INDENT# 'grant_type' : 'password' , #NEWLINE# 'client_id' : c . client_id , #NEWLINE# 'username' : self . get_user ( ) . username , #NEWLINE# 'password' : self . get_password ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 200 , response . status_code , response . content ) #NEWLINE# self . assertNotIn ( 'refresh_token' , json . loads ( response . content ) ) #NEWLINE# expires_in = json . loads ( response . content ) [ 'expires_in' ] #NEWLINE# expires_in_days = round ( ( expires_in_days / ( ( 60.0 * 60.0 ) * 24.0 ) ) ) #NEWLINE# self . assertEqual ( expires_in_days , constants . EXPIRE_DELTA_PUBLIC . days )