def test_financial_aid_email_error(self, raise_for_status, mock_post):
"""
Test that send_financial_aid_email handles errors correctly
"""
mock_post.return_value = Mock(
spec=Response,
status_code=HTTP_400_BAD_REQUEST,
json=mocked_json(),
)
response = MailgunClient.send_financial_aid_email(
self.staff_user_profile.user,
self.financial_aid,
'email subject',
'email body',
raise_for_status=raise_for_status,
)
assert response.raise_for_status.called is raise_for_status
assert response.status_code == HTTP_400_BAD_REQUEST
assert response.json() == {}
评论列表
文章目录