Fixed #29414 -- Restored form inputs on admin inlines when the user doesn't have the change permission.

Regression in 825f0beda8.
This commit is contained in:
Paulo Alvarado 2018-05-18 19:50:58 -04:00 committed by Tim Graham
parent a7bc1aea03
commit ffb72a95bc
4 changed files with 35 additions and 6 deletions

View file

@ -447,6 +447,16 @@ class TestInline(TestDataMixin, TestCase):
self.assertTrue(response.context['inline_admin_formset'].opts.has_registered_model)
self.assertNotContains(response, INLINE_CHANGELINK_HTML)
def test_noneditable_inline_has_field_inputs(self):
"""Inlines without change permission shows field inputs on add form."""
response = self.client.get(reverse('admin:admin_inlines_novelreadonlychapter_add'))
self.assertContains(
response,
'<input type="text" name="chapter_set-0-name" '
'class="vTextField" maxlength="40" id="id_chapter_set-0-name">',
html=True
)
@override_settings(ROOT_URLCONF='admin_inlines.urls')
class TestInlineMedia(TestDataMixin, TestCase):