Update test_admin.py

This commit is contained in:
zandercymatics 2023-12-21 13:23:27 -07:00
parent 0933a260b9
commit a75ddb213c
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -716,6 +716,7 @@ class TestDomainApplicationAdmin(MockEppLib):
"Cannot edit an application with a restricted creator.",
)
@boto3_mocking.patching
def test_error_when_saving_approved_to_rejected_and_domain_is_active(self):
# Create an instance of the model
application = completed_application(status=DomainApplication.ApplicationStatus.APPROVED)
@ -737,6 +738,9 @@ class TestDomainApplicationAdmin(MockEppLib):
stack.enter_context(patch.object(Domain, "is_active", custom_is_active))
stack.enter_context(patch.object(messages, "error"))
mock_client = MagicMock()
with boto3_mocking.clients.handler_for("sesv2", mock_client):
with less_console_noise():
# Simulate saving the model
application.status = DomainApplication.ApplicationStatus.REJECTED
self.admin.save_model(request, application, None, True)