summaryrefslogtreecommitdiff
path: root/tests/admin_docs/tests.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2015-04-11 11:07:13 +0200
committerClaude Paroz <claude@2xlibre.net>2015-04-11 15:34:02 +0200
commit774d09a7dd62a5a7c90343e08ea38bcb065ecf94 (patch)
tree60a068d4545c2356db7a52a9546e97345a5dbf1d /tests/admin_docs/tests.py
parent190afb86187e42c449afe626cff31f65b4781aa2 (diff)
[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.
Diffstat (limited to 'tests/admin_docs/tests.py')
-rw-r--r--tests/admin_docs/tests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py
index 08e1578c9c..fe668e2119 100644
--- a/tests/admin_docs/tests.py
+++ b/tests/admin_docs/tests.py
@@ -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