'Verify that saving still functions even on email errors.'

def test_save_signal_failure_email(self):

    self.assertIsNone(self.api_access_request.id)
    mail_function = 'openedx.core.djangoapps.api_admin.models.send_mail'
    with mock.patch(mail_function, side_effect=SMTPException):
        with mock.patch.object(model_log, 'exception') as mock_model_log_exception:
            self.api_access_request.save()
    mock_model_log_exception.assert_called_once_with('Error    sending    API    user    notification    email    for    request    [%s].', self.api_access_request.id)
    self.assertIsNotNone(self.api_access_request.id)
    with mock.patch(mail_function, side_effect=SMTPException):
        with mock.patch.object(model_log, 'exception') as mock_model_log_exception:
            self.api_access_request.approve()
    mock_model_log_exception.assert_called_once_with('Error    sending    API    user    notification    email    for    request    [%s].', self.api_access_request.id)
    self.assertEqual(self.api_access_request.status, ApiAccessRequest.APPROVED)
