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 14:48:10 +0100
commitdb0e10c03735820aa64e46f015ac04657416f1bb (patch)
treef522e6a71805ebfef1cf2b3e547b02407cd52935 /tests/admin_docs
parent0b6797eedda56c7099797cfcc6a5de8710e6c72a (diff)
[4.2.x] Fixed #34286 -- Fixed admindocs markups for case-sensitive template/view names.
Backport of 1250483ebf73f7a82ff820b94092c63ce4238264 from main
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