mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-28 16:29:54 +02:00
add test
This commit is contained in:
parent
899bb76426
commit
a95ff2bf53
2 changed files with 7 additions and 1 deletions
|
@ -1095,6 +1095,12 @@ class TestDomainPermissions(TestWithDomainPermissions):
|
|||
)
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
with less_console_noise():
|
||||
response = self.client.get(
|
||||
reverse("domain-security-email", kwargs={"pk": self.domain.id})
|
||||
)
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
|
||||
class TestDomainDetail(TestWithDomainPermissions, WebTest):
|
||||
def setUp(self):
|
||||
|
|
|
@ -130,7 +130,7 @@ class DomainSecurityEmailView(DomainPermission, FormMixin, DetailView):
|
|||
"""The form is valid, call setter in model."""
|
||||
|
||||
# Set the security email from the form
|
||||
new_email = form.cleaned_data["security_email"]
|
||||
new_email = form.cleaned_data.get("security_email", "")
|
||||
domain = self.get_object()
|
||||
domain.set_security_email(new_email)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue