mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
lint
This commit is contained in:
parent
79636aad14
commit
f00a4c837c
2 changed files with 9 additions and 7 deletions
|
@ -311,7 +311,7 @@ class DomainInvitationEmail(unittest.TestCase):
|
|||
email, None, [mock_domain], mock_requestor, is_member_of_different_org
|
||||
)
|
||||
mock_send_invitation_email.assert_called_once_with(email, mock_requestor_email, [mock_domain], None)
|
||||
|
||||
|
||||
# Assert that the result is False
|
||||
self.assertFalse(result)
|
||||
|
||||
|
@ -320,7 +320,7 @@ class DomainInvitationEmail(unittest.TestCase):
|
|||
@patch("registrar.models.UserDomainRole.objects.filter")
|
||||
def test_send_emails_to_domain_managers_all_emails_sent_successfully(self, mock_filter, mock_send_templated_email):
|
||||
"""Test when all emails are sent successfully."""
|
||||
|
||||
|
||||
# Setup mocks
|
||||
mock_domain = MagicMock(spec=Domain)
|
||||
mock_requestor_email = "requestor@example.com"
|
||||
|
@ -360,7 +360,7 @@ class DomainInvitationEmail(unittest.TestCase):
|
|||
@patch("registrar.models.UserDomainRole.objects.filter")
|
||||
def test_send_emails_to_domain_managers_email_send_fails(self, mock_filter, mock_send_templated_email):
|
||||
"""Test when sending an email fails (raises EmailSendingError)."""
|
||||
|
||||
|
||||
# Setup mocks
|
||||
mock_domain = MagicMock(spec=Domain)
|
||||
mock_requestor_email = "requestor@example.com"
|
||||
|
@ -400,7 +400,7 @@ class DomainInvitationEmail(unittest.TestCase):
|
|||
@patch("registrar.models.UserDomainRole.objects.filter")
|
||||
def test_send_emails_to_domain_managers_no_domain_managers(self, mock_filter, mock_send_templated_email):
|
||||
"""Test when there are no domain managers."""
|
||||
|
||||
|
||||
# Setup mocks
|
||||
mock_domain = MagicMock(spec=Domain)
|
||||
mock_requestor_email = "requestor@example.com"
|
||||
|
@ -421,7 +421,7 @@ class DomainInvitationEmail(unittest.TestCase):
|
|||
@patch("registrar.models.UserDomainRole.objects.filter")
|
||||
def test_send_emails_to_domain_managers_some_emails_fail(self, mock_filter, mock_send_templated_email):
|
||||
"""Test when some emails fail to send."""
|
||||
|
||||
|
||||
# Setup mocks
|
||||
mock_domain = MagicMock(spec=Domain)
|
||||
mock_requestor_email = "requestor@example.com"
|
||||
|
|
|
@ -84,8 +84,10 @@ def send_emails_to_domain_managers(email: str, requestor_email, domain: Domain,
|
|||
"date": date.today(),
|
||||
},
|
||||
)
|
||||
except EmailSendingError as err:
|
||||
logger.warning(f"Could not send email manager notification to {user.email} for domain: {domain.name}", exc_info=True)
|
||||
except EmailSendingError:
|
||||
logger.warning(
|
||||
f"Could not send email manager notification to {user.email} for domain: {domain.name}", exc_info=True
|
||||
)
|
||||
all_emails_sent = False
|
||||
return all_emails_sent
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue