#NEWLINE# def test_update_user_existing( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'display_name' : 'user-1' , #NEWLINE# 'email' : 'user-1@example.com' , #NEWLINE# #UNINDENT# } #NEWLINE# UserFactory . create ( ** data ) #NEWLINE# user = UserFactory . create ( ) #NEWLINE# view = UserAPIView . as_view ( ) #NEWLINE# request = self . factory . patch ( self . url , json . dumps ( data ) , content_type = 'application/json' ) #NEWLINE# request . user = user #NEWLINE# response = view ( request ) . render ( ) #NEWLINE# self . assertEqual ( response . status_code , 400 )