From e6b94e83a4f1356ac4104e5c07cbb40c0933c0cc Mon Sep 17 00:00:00 2001 From: Alysia Broddrick Date: Mon, 11 Sep 2023 06:04:21 -0700 Subject: [PATCH] removed unneeded comments and updated others --- src/registrar/tests/test_models_domain.py | 11 ++++++----- src/registrar/views/domain.py | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/registrar/tests/test_models_domain.py b/src/registrar/tests/test_models_domain.py index 913d6891a..26c5f930e 100644 --- a/src/registrar/tests/test_models_domain.py +++ b/src/registrar/tests/test_models_domain.py @@ -48,9 +48,10 @@ class MockEppLib(TestCase): ) def mockSend(self, _request, cleaned): - """""" - print("in mock send patch is ") - print(_request) + """Mocks the registry.send function used inside of domain.py + registry is imported from epplibwrapper + returns objects that simulate what would be in a epp response + but only relevant pieces for tests""" if isinstance(_request, commands.InfoDomain): if getattr(_request, "name", None) == "security.gov": return MagicMock(res_data=[self.infoDomainNoContact]) @@ -62,8 +63,8 @@ class MockEppLib(TestCase): and getattr(_request, "id", None) == "fail" and self.mockedSendFunction.call_count == 3 ): - print("raising error") - + #use this for when a contact is being updated + #sets the second send() to fail raise RegistryError(code=ErrorCode.OBJECT_EXISTS) return MagicMock(res_data=[self.mockDataInfoHosts]) diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 021f526f0..3da4de3fa 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -272,13 +272,12 @@ class DomainSecurityEmailView(DomainPermissionView, FormMixin): # Set the security email from the form new_email = form.cleaned_data.get("security_email", "") + domain = self.get_object() contact = domain.security_contact contact.email = new_email contact.save() - ##update security email here - # call the setter messages.success( self.request, "The security email for this domain have been updated." )