mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #27409 -- Made admindocs support custom link text in docstrings.
This commit is contained in:
parent
78c9a27031
commit
c2c544cf01
5 changed files with 60 additions and 3 deletions
|
|
@ -441,6 +441,25 @@ class TestModelDetailView(TestDataMixin, AdminDocsTestCase):
|
|||
self.assertContains(self.response, body, html=True)
|
||||
self.assertContains(self.response, model_body, html=True)
|
||||
|
||||
def test_model_docstring_built_in_tag_links(self):
|
||||
summary = "Links with different link text."
|
||||
body = (
|
||||
'<p>This is a line with tag <a class="reference external" '
|
||||
'href="/admindocs/tags/#built_in-extends">extends</a>\n'
|
||||
'This is a line with model <a class="reference external" '
|
||||
'href="/admindocs/models/myapp.family/">Family</a>\n'
|
||||
'This is a line with view <a class="reference external" '
|
||||
'href="/admindocs/views/myapp.views.Index/">Index</a>\n'
|
||||
'This is a line with template <a class="reference external" '
|
||||
'href="/admindocs/templates/Index.html/">index template</a>\n'
|
||||
'This is a line with filter <a class="reference external" '
|
||||
'href="/admindocs/filters/#filtername">example filter</a></p>'
|
||||
)
|
||||
url = reverse("django-admindocs-models-detail", args=["admin_docs", "family"])
|
||||
response = self.client.get(url)
|
||||
self.assertContains(response, summary, html=True)
|
||||
self.assertContains(response, body, html=True)
|
||||
|
||||
def test_model_detail_title(self):
|
||||
self.assertContains(self.response, "<h1>admin_docs.Person</h1>", html=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue