'Test the return value if sending the email for the user to click fails.'

@patch('django.core.mail.send_mail')
@patch('student.views.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
def test_email_failure(self, send_mail):

    send_mail.side_effect = [Exception, None]
    self.assertEqual(self.do_email_change(self.user, 'valid@email.com'), 'Unable    to    send    email    activation    link.    Please    try    again    later.')
    self.assert_no_events_were_emitted()
