summaryrefslogtreecommitdiff
path: root/tests/admin_inlines/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/admin_inlines/tests.py')
-rw-r--r--tests/admin_inlines/tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py
index 3bd3c881d4..f61ed1aeb2 100644
--- a/tests/admin_inlines/tests.py
+++ b/tests/admin_inlines/tests.py
@@ -241,6 +241,22 @@ class TestInline(TestDataMixin, TestCase):
# column cells
self.assertContains(response, "<p>Callable in QuestionInline</p>")
+ def test_model_error_inline_with_readonly_field(self):
+ poll = Poll.objects.create(name="Test poll")
+ data = {
+ "question_set-TOTAL_FORMS": 1,
+ "question_set-INITIAL_FORMS": 0,
+ "question_set-MAX_NUM_FORMS": 0,
+ "_save": "Save",
+ "question_set-0-text": "Question",
+ "question_set-0-poll": poll.pk,
+ }
+ response = self.client.post(
+ reverse("admin:admin_inlines_poll_change", args=(poll.pk,)),
+ data,
+ )
+ self.assertContains(response, "Always invalid model.")
+
def test_help_text(self):
"""
The inlines' model field help texts are displayed when using both the