summaryrefslogtreecommitdiff
path: root/tests/admin_docs
diff options
context:
space:
mode:
authorskidipap <mad.skidipap@gmail.com>2023-02-01 17:18:35 +0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-02-02 13:21:08 +0100
commit1250483ebf73f7a82ff820b94092c63ce4238264 (patch)
tree5c4bf71a5439a6ead50e86705219fb2223214c5f /tests/admin_docs
parentc626173833784c86920b448793ac45005af4c058 (diff)
downloaddjango-1250483ebf73f7a82ff820b94092c63ce4238264.tar.gz
Fixed #34286 -- Fixed admindocs markups for case-sensitive template/view names.
Diffstat (limited to 'tests/admin_docs')
-rw-r--r--tests/admin_docs/test_utils.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/admin_docs/test_utils.py b/tests/admin_docs/test_utils.py
index 18c6769fad..8152857263 100644
--- a/tests/admin_docs/test_utils.py
+++ b/tests/admin_docs/test_utils.py
@@ -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