From 401ad77385a41e7a329d89d30419f87f67ea2b7b Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:04:44 -0700 Subject: [PATCH] Update test_admin.py --- src/registrar/tests/test_admin.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index 923b7b06a..153c87b42 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -654,8 +654,10 @@ class TestDomainApplicationAdmin(MockEppLib): def test_readonly_when_restricted_creator(self): application = completed_application(status=DomainApplication.ApplicationStatus.IN_REVIEW) - application.creator.status = User.RESTRICTED - application.creator.save() + with boto3_mocking.clients.handler_for("sesv2", self.mock_client): + with less_console_noise(): + application.creator.status = User.RESTRICTED + application.creator.save() request = self.factory.get("/") request.user = self.superuser @@ -733,8 +735,10 @@ class TestDomainApplicationAdmin(MockEppLib): def test_saving_when_restricted_creator(self): # Create an instance of the model application = completed_application(status=DomainApplication.ApplicationStatus.IN_REVIEW) - application.creator.status = User.RESTRICTED - application.creator.save() + with boto3_mocking.clients.handler_for("sesv2", self.mock_client): + with less_console_noise(): + application.creator.status = User.RESTRICTED + application.creator.save() # Create a request object with a superuser request = self.factory.get("/") @@ -756,8 +760,10 @@ class TestDomainApplicationAdmin(MockEppLib): def test_change_view_with_restricted_creator(self): # Create an instance of the model application = completed_application(status=DomainApplication.ApplicationStatus.IN_REVIEW) - application.creator.status = User.RESTRICTED - application.creator.save() + with boto3_mocking.clients.handler_for("sesv2", self.mock_client): + with less_console_noise(): + application.creator.status = User.RESTRICTED + application.creator.save() with patch("django.contrib.messages.warning") as mock_warning: # Create a request object with a superuser