mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-25 05:39:57 +02:00
removed unneeded comments and updated others
This commit is contained in:
parent
d476a1b377
commit
e6b94e83a4
2 changed files with 7 additions and 7 deletions
|
@ -48,9 +48,10 @@ class MockEppLib(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def mockSend(self, _request, cleaned):
|
def mockSend(self, _request, cleaned):
|
||||||
""""""
|
"""Mocks the registry.send function used inside of domain.py
|
||||||
print("in mock send patch is ")
|
registry is imported from epplibwrapper
|
||||||
print(_request)
|
returns objects that simulate what would be in a epp response
|
||||||
|
but only relevant pieces for tests"""
|
||||||
if isinstance(_request, commands.InfoDomain):
|
if isinstance(_request, commands.InfoDomain):
|
||||||
if getattr(_request, "name", None) == "security.gov":
|
if getattr(_request, "name", None) == "security.gov":
|
||||||
return MagicMock(res_data=[self.infoDomainNoContact])
|
return MagicMock(res_data=[self.infoDomainNoContact])
|
||||||
|
@ -62,8 +63,8 @@ class MockEppLib(TestCase):
|
||||||
and getattr(_request, "id", None) == "fail"
|
and getattr(_request, "id", None) == "fail"
|
||||||
and self.mockedSendFunction.call_count == 3
|
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)
|
raise RegistryError(code=ErrorCode.OBJECT_EXISTS)
|
||||||
return MagicMock(res_data=[self.mockDataInfoHosts])
|
return MagicMock(res_data=[self.mockDataInfoHosts])
|
||||||
|
|
||||||
|
|
|
@ -272,13 +272,12 @@ class DomainSecurityEmailView(DomainPermissionView, FormMixin):
|
||||||
|
|
||||||
# Set the security email from the form
|
# Set the security email from the form
|
||||||
new_email = form.cleaned_data.get("security_email", "")
|
new_email = form.cleaned_data.get("security_email", "")
|
||||||
|
|
||||||
domain = self.get_object()
|
domain = self.get_object()
|
||||||
contact = domain.security_contact
|
contact = domain.security_contact
|
||||||
contact.email = new_email
|
contact.email = new_email
|
||||||
contact.save()
|
contact.save()
|
||||||
|
|
||||||
##update security email here
|
|
||||||
# call the setter
|
|
||||||
messages.success(
|
messages.success(
|
||||||
self.request, "The security email for this domain have been updated."
|
self.request, "The security email for this domain have been updated."
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue