#NEWLINE# def test_register_redirects_edit( self ) : #NEWLINE# #INDENT# user_qs = UserProfile . objects . filter ( email = 'me@yeahoo.com' ) #NEWLINE# assert ( not user_qs . exists ( ) ) #NEWLINE# identity = { #NEWLINE# #INDENT# 'email' : 'me@yeahoo.com' , #NEWLINE# 'uid' : 'e0b6f' , #NEWLINE# #UNINDENT# } #NEWLINE# self . fxa_identify . return_value = identity #NEWLINE# response = self . client . get ( self . url , { #NEWLINE# #INDENT# 'code' : 'codes!!' , #NEWLINE# 'state' : ':' . join ( [ self . fxa_state , base64 . urlsafe_b64encode ( '/go/here' ) ] ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertRedirects ( response , reverse ( 'users.edit' ) , target_status_code = 302 ) #NEWLINE# self . fxa_identify . assert_called_with ( 'codes!!' , config = FXA_CONFIG ) #NEWLINE# assert ( not self . login_user . called ) #NEWLINE# self . register_user . assert_called_with ( mock . ANY , identity )