mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-12 20:49:41 +02:00
Initialize email tests
This commit is contained in:
parent
691220698d
commit
59bda0b3cc
3 changed files with 14 additions and 7 deletions
|
@ -1518,7 +1518,6 @@ class DomainInvitationAdmin(BaseInvitationAdmin):
|
|||
# Get the filtered values
|
||||
return super().changelist_view(request, extra_context=extra_context)
|
||||
|
||||
|
||||
def delete_view(self, request, object_id, extra_context=None):
|
||||
"""
|
||||
Custom delete_view to perform additional actions or customize the template.
|
||||
|
|
|
@ -980,6 +980,14 @@ class TestDomainManagers(TestDomainOverview):
|
|||
success_page = success_result.follow()
|
||||
self.assertContains(success_page, "Failed to send email.")
|
||||
|
||||
@boto3_mocking.patching
|
||||
@less_console_noise_decorator
|
||||
def test_domain_remove_manager(self):
|
||||
"""Removing a domain manager sends notification email to other domain managers."""
|
||||
print("self:", self)
|
||||
response = self.client.get(reverse("domain-user-delete", kwargs={"pk": self.domain.id, "user_pk": self.user.id}))
|
||||
print("response: ", response)
|
||||
|
||||
@less_console_noise_decorator
|
||||
@patch("registrar.views.domain.send_domain_invitation_email")
|
||||
def test_domain_invitation_created(self, mock_send_domain_email):
|
||||
|
|
|
@ -1344,7 +1344,7 @@ class DomainDeleteUserView(UserDomainRolePermissionDeleteView):
|
|||
"removed_by": self.request.user,
|
||||
"manager_removed": self.object.user,
|
||||
"date": date.today(),
|
||||
"changes": "Domain Manager"
|
||||
"changes": "Domain Manager",
|
||||
}
|
||||
self.email_domain_managers(
|
||||
domain,
|
||||
|
@ -1368,7 +1368,7 @@ class DomainDeleteUserView(UserDomainRolePermissionDeleteView):
|
|||
send_templated_email(
|
||||
template,
|
||||
subject_template,
|
||||
to_address=email, # type: ignore
|
||||
to_address=email,
|
||||
context=context,
|
||||
)
|
||||
except EmailSendingError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue