|
@@ -603,11 +603,13 @@ class TestFormPageWithCustomFormBuilder(WagtailTestUtils, TestCase):
|
|
|
html=True,
|
|
|
)
|
|
|
# check ip address field has rendered
|
|
|
- self.assertContains(
|
|
|
- response,
|
|
|
- '<input type="text" name="device_ip_address" required id="id_device_ip_address" />',
|
|
|
- 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(
|