#NEWLINE# def test_valid_message_remove( self ) : #NEWLINE# #INDENT# ' ``POST`` to remove a message ' #NEWLINE# response = self . client . post ( reverse ( 'userena_umessages_remove' ) ) #NEWLINE# self . assertEqual ( response . status_code , 302 ) #NEWLINE# client = self . client . login ( username = 'john' , password = 'blowfish' ) #NEWLINE# response = self . client . get ( reverse ( 'userena_umessages_remove' ) ) #NEWLINE# self . assertEqual ( response . status_code , 405 ) #NEWLINE# response = self . client . post ( reverse ( 'userena_umessages_remove' ) , data = { #NEWLINE# #INDENT# 'message_pks' : '1' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertRedirects ( response , reverse ( 'userena_umessages_list' ) ) #NEWLINE# msg = Message . objects . get ( pk = 1 ) #NEWLINE# self . assertTrue ( response . sender_deleted_at ) #NEWLINE# client = self . client . login ( username = 'jane' , password = 'blowfish' ) #NEWLINE# response = self . client . post ( reverse ( 'userena_umessages_remove' ) , data = { #NEWLINE# #INDENT# 'message_pks' : '1' , #NEWLINE# 'next' : reverse ( 'userena_umessages_list' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertRedirects ( response , reverse ( 'userena_umessages_list' ) ) #NEWLINE# jane = User . objects . get ( username = 'jane' ) #NEWLINE# mr = msg . messagerecipient_set . get ( user = jane , message = msg ) #NEWLINE# self . assertTrue ( mr . deleted_at )