summaryrefslogtreecommitdiff
path: root/tests/admin_changelist/tests.py
diff options
context:
space:
mode:
authorsanjeevholla26 <sanjeevholla26@gmail.com>2024-08-30 23:44:32 +0530
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-09-02 15:19:33 +0200
commit387475c5b2f1aa32103dbe21cb281d3b35165a0c (patch)
treec239d02a75de21531ef368e08e68ae05f68ac75a /tests/admin_changelist/tests.py
parente4a2e22ddbf1b892144b35dc21404c164bc848c6 (diff)
Refs #35706 -- Prefixed 'Error:' to titles of admin pages with form errors.
This improves the screen reader experience.
Diffstat (limited to 'tests/admin_changelist/tests.py')
-rw-r--r--tests/admin_changelist/tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py
index ec6820c62f..694f807781 100644
--- a/tests/admin_changelist/tests.py
+++ b/tests/admin_changelist/tests.py
@@ -1264,6 +1264,24 @@ class ChangeListTests(TestCase):
# Check only the first few characters since the UUID may have dashes.
self.assertIn(str(a.pk)[:8], context.captured_queries[4]["sql"])
+ def test_list_editable_error_title(self):
+ a = Swallow.objects.create(origin="Swallow A", load=4, speed=1)
+ Swallow.objects.create(origin="Swallow B", load=2, speed=2)
+ data = {
+ "form-TOTAL_FORMS": "2",
+ "form-INITIAL_FORMS": "2",
+ "form-MIN_NUM_FORMS": "0",
+ "form-MAX_NUM_FORMS": "1000",
+ "form-0-uuid": str(a.pk),
+ "form-0-load": "invalid",
+ "_save": "Save",
+ }
+ superuser = self._create_superuser("superuser")
+ self.client.force_login(superuser)
+ changelist_url = reverse("admin:admin_changelist_swallow_changelist")
+ response = self.client.post(changelist_url, data=data)
+ self.assertContains(response, "Error: Select swallow to change")
+
def test_deterministic_order_for_unordered_model(self):
"""
The primary key is used in the ordering of the changelist's results to