removed unneeded comments and updated others

This commit is contained in:
Alysia Broddrick 2023-09-11 06:04:21 -07:00
parent d476a1b377
commit e6b94e83a4
No known key found for this signature in database
GPG key ID: 03917052CD0F06B7
2 changed files with 7 additions and 7 deletions

View file

@ -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])

View file

@ -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."
)