1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #34286 -- Fixed admindocs markups for case-sensitive template/view names.

This commit is contained in:
skidipap
2023-02-01 17:18:35 +07:00
committed by Mariusz Felisiak
parent c626173833
commit 1250483ebf
3 changed files with 21 additions and 1 deletions

View File

@@ -104,6 +104,22 @@ class TestUtils(AdminDocsSimpleTestCase):
self.assertEqual(parse_rst(body, ""), "<p>second line</p>\n")
self.assertEqual(stderr.getvalue(), "")
def test_parse_rst_view_case_sensitive(self):
source = ":view:`myapp.views.Index`"
rendered = (
'<p><a class="reference external" '
'href="/admindocs/views/myapp.views.Index/">myapp.views.Index</a></p>'
)
self.assertHTMLEqual(parse_rst(source, "view"), rendered)
def test_parse_rst_template_case_sensitive(self):
source = ":template:`Index.html`"
rendered = (
'<p><a class="reference external" href="/admindocs/templates/Index.html/">'
"Index.html</a></p>"
)
self.assertHTMLEqual(parse_rst(source, "template"), rendered)
def test_publish_parts(self):
"""
Django shouldn't break the default role for interpreted text