#NEWLINE# def test_change_user_with_patch( self ) : #NEWLINE# #INDENT# user = UserFactory ( ) #NEWLINE# new_display_name = user . profile . name . upper ( ) #NEWLINE# data = { #NEWLINE# #INDENT# 'display_name' : new_display_name , #NEWLINE# 'locale' : 'en-US' , #NEWLINE# 'username' : user . username , #NEWLINE# 'password' : 'testpass' , #NEWLINE# #UNINDENT# } #NEWLINE# url = reverse ( 'user-detail' , args = [ new_display_name . username ] ) #NEWLINE# self . client . force_authenticate ( user = user ) #NEWLINE# res = self . client . patch ( url , data ) #NEWLINE# eq_ ( res . status_code , 200 ) #NEWLINE# user = User . objects . get ( id = user . id ) #NEWLINE# eq_ ( user . profile . display_name , new_display_name )