#NEWLINE# def test_email_is_not_sent_if_recipient_has_declined_such_emails( self ) : #NEWLINE# #INDENT# user_services . update_email_preferences ( self . new_user_id , True , False ) #NEWLINE# with self . can_send_emails_ctx , self . can_send_editor_role_email_ctx : #NEWLINE# #INDENT# email_manager . send_role_notification_email ( self . editor_id , self . new_user_id , rights_manager . ROLE_OWNER , self . exploration . id , self . exploration . title ) #NEWLINE# messages = self . mail_stub . get_sent_messages ( to = self . NEW_USER_EMAIL ) #NEWLINE# self . assertEqual ( len ( messages ) , 0 )