mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #29184 -- Made TabularInline respect model form's Meta.labels and help_texts.
This commit is contained in:
parent
3c4ff21763
commit
274e3e27f3
4 changed files with 25 additions and 3 deletions
|
@ -175,6 +175,21 @@ class TestInline(TestDataMixin, TestCase):
|
|||
1
|
||||
)
|
||||
|
||||
def test_tabular_model_form_meta_readonly_field(self):
|
||||
"""
|
||||
Tabular inlines use ModelForm.Meta.help_texts and labels for read-only
|
||||
fields.
|
||||
"""
|
||||
response = self.client.get(reverse('admin:admin_inlines_someparentmodel_add'))
|
||||
self.assertContains(
|
||||
response,
|
||||
'<img src="/static/admin/img/icon-unknown.svg" '
|
||||
'class="help help-tooltip" width="10" height="10" '
|
||||
'alt="(Help text from ModelForm.Meta)" '
|
||||
'title="Help text from ModelForm.Meta">'
|
||||
)
|
||||
self.assertContains(response, 'Label from ModelForm.Meta')
|
||||
|
||||
def test_inline_hidden_field_no_column(self):
|
||||
"""#18263 -- Make sure hidden fields don't get a column in tabular inlines"""
|
||||
parent = SomeParentModel.objects.create(name='a')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue