Do not emit comment line with trailng blank
[docutils.git] / test / test_writers / test_html4css1_misc.py
blobf363321e080c93cf85ccd0e7a6dc5152e3e6843d
1 #! /usr/bin/env python
3 # $Id$
4 # Author: Lea Wiemann <LeWiemann@gmail.com>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Miscellaneous HTML writer tests.
9 """
11 from __init__ import DocutilsTestSupport
12 from docutils import core
13 from docutils._compat import b
16 class EncodingTestCase(DocutilsTestSupport.StandardTestCase):
18 def test_xmlcharrefreplace(self):
19 # Test that xmlcharrefreplace is the default output encoding
20 # error handler.
21 settings_overrides={
22 'output_encoding': 'latin1',
23 'stylesheet': '',
24 '_disable_config': 1,}
25 result = core.publish_string(
26 b('EUR = \xe2\x82\xac'), writer_name='html4css1',
27 settings_overrides=settings_overrides)
28 # Encoding a euro sign with latin1 doesn't work, so the
29 # xmlcharrefreplace handler is used.
30 self.assert_(result.find(b('EUR = &#8364;')) != -1)
33 if __name__ == '__main__':
34 import unittest
35 unittest.main()