diff --git a/wagtail/contrib/forms/tests/test_models.py b/wagtail/contrib/forms/tests/test_models.py index 05a309c6ef..e4ceb5a629 100644 --- a/wagtail/contrib/forms/tests/test_models.py +++ b/wagtail/contrib/forms/tests/test_models.py @@ -611,11 +611,13 @@ class TestFormPageWithCustomFormBuilder(WagtailTestUtils, TestCase): html=True, ) # check ip address field has rendered - self.assertContains( - response, - '', - html=True, - ) + # (not comparing HTML directly because https://docs.djangoproject.com/en/5.1/releases/5.1.5/ + # added a maxlength attribute) + soup = self.get_soup(response.content) + input = soup.find("input", {"name": "device_ip_address"}) + self.assertEqual(input["type"], "text") + self.assertEqual(input["required"], "") + self.assertEqual(input["id"], "id_device_ip_address") def test_post_invalid_form(self): response = self.client.post(