Update test and add in documentation

This commit is contained in:
Rebecca Hsieh 2025-01-06 14:32:16 -08:00
parent a3c50043c5
commit 3dc445d17d
No known key found for this signature in database
3 changed files with 53 additions and 3 deletions

View file

@ -576,7 +576,7 @@ class TestDomainDetailDomainRenewal(TestDomainOverview):
self.assertContains(edit_page, "Review the details below and update any required information")
@override_flag("domain_renewal", active=True)
def test_domain_renewal_form_security_contact_edit(self):
def test_domain_renewal_form_security_email_edit(self):
with less_console_noise():
# Start on the Renewal page for the domain
renewal_page = self.app.get(reverse("domain-renewal", kwargs={"pk": self.domain_with_ip.id}))
@ -584,6 +584,9 @@ class TestDomainDetailDomainRenewal(TestDomainOverview):
# Verify we see "Security email" on the renewal form
self.assertContains(renewal_page, "Security email")
# Verify we see "strong recommend" blurb
self.assertContains(renewal_page, "We strongly recommend that you provide a security email.")
# Verify that the "Edit" button for Security email is there and links to correct URL
edit_button_url = reverse("domain-security-email", kwargs={"pk": self.domain_with_ip.id})
self.assertContains(renewal_page, f'href="{edit_button_url}"')

View file

@ -380,9 +380,9 @@ class DomainRenewalView(DomainBaseView):
if "submit_button" in request.POST:
try:
domain.renew_domain()
messages.success(request, "This domain has been renewed for one year")
messages.success(request, "This domain has been renewed for one year.")
except Exception as e:
messages.error(request, "*** This domain has not been renewed")
messages.error(request, "This domain has not been renewed for one year, error was %s" % e)
return HttpResponseRedirect(reverse("domain", kwargs={"pk": pk}))