#NEWLINE# @ responses . activate #NEWLINE# @ override_settings ( ACCOUNT_EMAIL_VERIFICATION = 'mandatory' , ACCOUNT_EMAIL_REQUIRED = True , REST_SESSION_LOGIN = False ) #NEWLINE# def test_edge_case( 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,"email":"%s"}' #NEWLINE# responses . add ( responses . GET , self . graph_api_url , body = ( resp_body % self . EMAIL ) , status = 200 , content_type = 'application/json' ) #NEWLINE# self . post ( email_confirmation . register_url , data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , status_code = 400 ) #NEWLINE# self . post ( self . register_url , data = self . REGISTRATION_DATA , status_code = 201 ) #NEWLINE# new_user = get_user_model ( ) . objects . latest ( 'id' ) #NEWLINE# self . assertEqual ( new_user . username , self . REGISTRATION_DATA [ 'username' ] ) #NEWLINE# email_confirmation = new_user . emailaddress_set . get ( email = self . EMAIL ) . emailconfirmation_set . order_by ( '-created' ) [ 0 ] #NEWLINE# self . post ( self . veirfy_email_url , data = { #NEWLINE# #INDENT# 'key' : email_confirmation . key , #NEWLINE# #UNINDENT# } , status_code = status . HTTP_200_OK ) #NEWLINE# self . _login ( ) #NEWLINE# self . _logout ( ) #NEWLINE# payload = { #NEWLINE# #INDENT# 'access_token' : 'abc123' , #NEWLINE# #UNINDENT# } #NEWLINE# self . post ( self . fb_login_url , data = payload , status_code = 200 ) #NEWLINE# self . assertIn ( 'key' , self . response . json . keys ( ) )