mirror of
https://github.com/django/django.git
synced 2025-08-08 12:58:37 +00:00
[1.8.x] Fixed #24624 -- Replaced obsoleted rel.opts in admindocs view
Thanks Scott Sanders for the report, and Markus Holtermann and
Tim Graham for the reviews. Refs #24381.
Backport of 4e7ed8d0d
from master.
This commit is contained in:
parent
190afb8618
commit
774d09a7dd
3 changed files with 20 additions and 2 deletions
|
@ -280,6 +280,20 @@ class TestModelDetailView(AdminDocsTestCase):
|
|||
"all related %s objects" % (link % ("admin_docs.group", "admin_docs.Group"))
|
||||
)
|
||||
|
||||
def test_model_with_many_to_one(self):
|
||||
link = '<a class="reference external" href="/admindocs/models/%s/">%s</a>'
|
||||
response = self.client.get(
|
||||
reverse('django-admindocs-models-detail', args=['admin_docs', 'company'])
|
||||
)
|
||||
self.assertContains(
|
||||
response,
|
||||
"number of related %s objects" % (link % ("admin_docs.person", "admin_docs.Person"))
|
||||
)
|
||||
self.assertContains(
|
||||
response,
|
||||
"all related %s objects" % (link % ("admin_docs.person", "admin_docs.Person"))
|
||||
)
|
||||
|
||||
def test_model_with_no_backward_relations_render_only_relevant_fields(self):
|
||||
"""
|
||||
A model with ``related_name`` of `+` should not show backward relationship
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue