MCPcopy
hub / github.com/django/django / test_parse_rst

Method test_parse_rst

tests/admin_docs/test_utils.py:89–98  ·  view source on GitHub ↗

parse_rst() should use `cmsreference` as the default role.

(self)

Source from the content-addressed store, hash-verified

87 self.assertIn("<h3>Header</h3>", output)
88
89 def test_parse_rst(self):
90 """
91 parse_rst() should use `cmsreference` as the default role.
92 """
93 markup = '<p><a class="reference external" href="/admindocs/%s">title</a></p>\n'
94 self.assertEqual(parse_rst("`title`", "model"), markup % "models/title/")
95 self.assertEqual(parse_rst("`title`", "view"), markup % "views/title/")
96 self.assertEqual(parse_rst("`title`", "template"), markup % "templates/title/")
97 self.assertEqual(parse_rst("`title`", "filter"), markup % "filters/#title")
98 self.assertEqual(parse_rst("`title`", "tag"), markup % "tags/#title")
99
100 def test_parse_rst_with_docstring_no_leading_line_feed(self):
101 title, body, _ = parse_docstring("firstline\n\n second line")

Callers

nothing calls this directly

Calls 1

parse_rstFunction · 0.90

Tested by

no test coverage detected