Fix checkbox unchecked test

This commit is contained in:
Rebecca Hsieh 2025-01-07 17:40:37 -08:00
parent e196e02d92
commit aad1ee976b
No known key found for this signature in database

View file

@ -631,19 +631,11 @@ class TestDomainDetailDomainRenewal(TestDomainOverview):
# Grab the renewal URL # Grab the renewal URL
renewal_url = reverse("domain-renewal", kwargs={"pk": self.domain_with_ip.id}) renewal_url = reverse("domain-renewal", kwargs={"pk": self.domain_with_ip.id})
# Test clicking the checkbox # Test that the checkbox is not checked
response = self.client.post(renewal_url, data={"submit_button": "next"}) response = self.client.post(renewal_url, data={"submit_button": "next"})
# Verify the error message is displayed error_message = "Check the box if you read and agree to the requirements for operating a .gov domain."
# Retrieves messages obj (used in the post call) self.assertContains(response, error_message)
messages = list(get_messages(response.wsgi_request))
# Check we only get 1 error message
self.assertEqual(len(messages), 1)
# Check that the 1 error msg also is the right text
self.assertEqual(
str(messages[0]),
"Check the box if you read and agree to the requirements for operating a .gov domain.",
)
@override_flag("domain_renewal", active=True) @override_flag("domain_renewal", active=True)
def test_ack_checkbox_checked(self): def test_ack_checkbox_checked(self):