summaryrefslogtreecommitdiff
path: root/tests/admin_changelist/tests.py
diff options
context:
space:
mode:
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