From 4e7ed8d0d3e29e21d46abe06ac244da3754c82cc Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 11 Apr 2015 11:07:13 +0200 Subject: 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. --- tests/admin_docs/tests.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/admin_docs') diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py index 0881de20ee..b4f78477df 100644 --- a/tests/admin_docs/tests.py +++ b/tests/admin_docs/tests.py @@ -290,6 +290,20 @@ class TestModelDetailView(TestDataMixin, AdminDocsTestCase): "all related %s objects" % (link % ("admin_docs.group", "admin_docs.Group")) ) + def test_model_with_many_to_one(self): + link = '%s' + 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 -- cgit v1.3