#NEWLINE# def test_receive_missed_personal_message_email_messages( self ) : #NEWLINE# #INDENT# self . login ( 'hamlet@zulip.com' ) #NEWLINE# result = self . client . post ( '/json/messages' , { #NEWLINE# #INDENT# 'type' : 'private' , #NEWLINE# 'content' : 'test_receive_missed_message_email_messages' , #NEWLINE# 'client' : 'test suite' , #NEWLINE# 'to' : 'othello@zulip.com' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assert_json_success ( result ) #NEWLINE# user_profile = get_user_profile_by_email ( 'othello@zulip.com' ) #NEWLINE# usermessage = most_recent_usermessage ( user_profile ) #NEWLINE# mm_address = create_missed_message_address ( user_profile , usermessage . message ) #NEWLINE# incoming_valid_message = MIMEText ( 'TestMissedMessageEmailMessages Body' ) #NEWLINE# incoming_valid_message [ 'Subject' ] = 'TestMissedMessageEmailMessages Subject' #NEWLINE# incoming_valid_message [ 'From' ] = 'othello@zulip.com' #NEWLINE# incoming_valid_message [ 'To' ] = mm_address #NEWLINE# incoming_valid_message [ 'Reply-to' ] = 'othello@zulip.com' #NEWLINE# process_message ( incoming_valid_message ) #NEWLINE# user_profile = get_user_profile_by_email ( 'hamlet@zulip.com' ) #NEWLINE# message = most_recent_message ( user_profile ) #NEWLINE# self . assertEqual ( message . content , 'TestMissedMessageEmailMessages Body' ) #NEWLINE# self . assertEqual ( message . sender , get_user_profile_by_email ( 'othello@zulip.com' ) ) #NEWLINE# self . assertEqual ( mm_address . recipient . id , user_profile . id ) #NEWLINE# self . assertEqual ( message . recipient . type , Recipient . PERSONAL )