#NEWLINE# def test_key_in_post( self ) : #NEWLINE# #INDENT# '\n        Ensure a key is in the post.\n        ' #NEWLINE# self . client . login ( username = 'miles' , password = 'pw' ) #NEWLINE# data = { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'type' : 'users' , #NEWLINE# 'id' : encoding . force_text ( response . miles . pk ) , #NEWLINE# 'attributes' : { #NEWLINE# #INDENT# 'first-name' : self . miles . first_name , #NEWLINE# 'last-name' : self . miles . last_name , #NEWLINE# 'email' : 'miles@trumpet.org' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . put ( self . detail_url , content_type = 'application/vnd.api+json' , data = dump_json ( data ) ) #NEWLINE# content_dump = redump_json ( response . content ) #NEWLINE# expected_dump = dump_json ( data ) #NEWLINE# assert ( expected_dump == content_dump ) #NEWLINE# self . assertEqual ( get_user_model ( ) . objects . get ( pk = self . miles . pk ) . email , 'miles@trumpet.org' )