~ubuntu-branches/ubuntu/karmic/python-docutils/karmic

« back to all changes in this revision

Viewing changes to test/test_writers/test_html4css1_misc.py

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
 
 
3
# Author: Felix Wiemann
 
4
# Contact: Felix_Wiemann@ososo.de
 
5
# Revision: $Revision: 3968 $
 
6
# Date: $Date: 2005-10-29 14:28:44 +0200 (Sat, 29 Oct 2005) $
 
7
# Copyright: This module has been placed in the public domain.
 
8
 
 
9
"""
 
10
Miscellaneous HTML writer tests.
 
11
"""
 
12
 
 
13
from __init__ import DocutilsTestSupport
 
14
from docutils import core
 
15
 
 
16
 
 
17
class EncodingTestCase(DocutilsTestSupport.StandardTestCase):
 
18
 
 
19
    def test_xmlcharrefreplace(self):
 
20
        # Test that xmlcharrefreplace is the default output encoding
 
21
        # error handler.
 
22
        settings_overrides={
 
23
            'output_encoding': 'latin1',
 
24
            'stylesheet': '',
 
25
            '_disable_config': 1,}
 
26
        result = core.publish_string(
 
27
            'EUR = \xe2\x82\xac', writer_name='html4css1',
 
28
            settings_overrides=settings_overrides)
 
29
        # Encoding a euro sign with latin1 doesn't work, so the
 
30
        # xmlcharrefreplcae handler is used.
 
31
        self.assert_(result.find('EUR = €') != -1)
 
32
 
 
33
 
 
34
if __name__ == '__main__':
 
35
    import unittest
 
36
    unittest.main()