#NEWLINE# @ responses . activate #NEWLINE# @ override_settings ( REST_USE_JWT = True ) #NEWLINE# def test_jwt( self ) : #NEWLINE# #INDENT# resp_body = '{"id":"123123123123","first_name":"John","gender":"male","last_name":"Smith","link":"https:\\/\\/www.facebook.com\\/john.smith","locale":"en_US","name":"John Smith","timezone":2,"updated_time":"2014-08-13T10:14:38+0000","username":"john.smith","verified":true}' #NEWLINE# responses . add ( responses . GET , payload . graph_api_url , body = resp_body , status = 200 , content_type = 'application/json' ) #NEWLINE# users_count = get_user_model ( ) . objects . all ( ) . count ( ) #NEWLINE# payload = { #NEWLINE# #INDENT# 'access_token' : 'abc123' , #NEWLINE# #UNINDENT# } #NEWLINE# self . post ( self . fb_login_url , data = payload , status_code = 200 ) #NEWLINE# self . assertIn ( 'token' , self . response . json . keys ( ) ) #NEWLINE# self . assertIn ( 'user' , self . response . json . keys ( ) ) #NEWLINE# self . assertEqual ( get_user_model ( ) . objects . all ( ) . count ( ) , ( users_count + 1 ) )