[Zope-Checkins]
SVN: Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py
some more tests to document the conversion behavior before
Andreas Jung
andreas at andreas-jung.com
Mon Mar 13 07:52:14 EST 2006
Log message for revision 65938:
some more tests to document the conversion behavior before
the next docutils migration
Changed:
U Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py
-=-
Modified: Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py
===================================================================
--- Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py 2006-03-13 12:16:56 UTC (rev 65937)
+++ Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py 2006-03-13 12:52:13 UTC (rev 65938)
@@ -1,3 +1,5 @@
+# -*- coding: iso-8859-15 -*-
+
""" Unit tests for ZReST objects
$Id$
@@ -4,6 +6,20 @@
"""
import unittest
+txt = """Hello World
+============
+
+text text
+
+Von Vögeln und Öfen
+===================
+
+- some
+- more
+- text
+
+"""
+
class TestZReST(unittest.TestCase):
def _getTargetClass(self):
@@ -29,6 +45,25 @@
self.failIf('IGNORE ME' in resty.index_html())
+ def testConversion(self):
+ resty = self._makeOne()
+ resty.source = txt
+ resty.input_encoding = 'iso-8859-15'
+ resty.output_encoding = 'iso-8859-15'
+ resty.render()
+ html = resty.index_html()
+
+ s = '<h1><a name="hello-world">Hello World</a></h1>'
+ self.assertEqual(s in html, True)
+
+ s = '<h1><a name="von-v-geln-und-fen">Von Vögeln und Öfen</a></h1>'
+ self.assertEqual(s in html, True)
+
+ # ZReST should render a complete HTML document
+ self.assertEqual('<html' in html, True)
+ self.assertEqual('<body>' in html, True)
+
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestZReST))
More information about the Zope-Checkins
mailing list