4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
8 Tests for docutils.transforms.universal.Messages.
11 from __init__
import DocutilsTestSupport
12 from docutils
.transforms
.universal
import Messages
13 from docutils
.transforms
.references
import Substitutions
14 from docutils
.parsers
.rst
import Parser
19 s
= DocutilsTestSupport
.TransformTestSuite(parser
)
20 s
.generateTests(totest
)
25 totest
['system_message_sections'] = ((Substitutions
, Messages
), [
27 This |unknown substitution| will generate a system message, thanks to
28 the ``Substitutions`` transform. The ``Messages`` transform will
29 generate a "System Messages" section.
31 (A second copy of the system message is tacked on to the end of the
32 document by the test framework.)
35 <document source="test data">
38 <problematic ids="id2" refid="id1">
39 |unknown substitution|
40 will generate a system message, thanks to
48 generate a "System Messages" section.
50 (A second copy of the system message is tacked on to the end of the
51 document by the test framework.)
52 <section classes="system-messages">
54 Docutils System Messages
55 <system_message backrefs="id2" ids="id1" level="3" line="1" source="test data" type="ERROR">
57 Undefined substitution referenced: "unknown substitution".
62 if __name__
== '__main__':
64 unittest
.main(defaultTest
='suite')