[Zope-Checkins]
SVN: Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py
tests for 'include' and 'raw' directives (which should
Andreas Jung
andreas at andreas-jung.com
Sun Jul 9 03:27:12 EDT 2006
Log message for revision 69053:
tests for 'include' and 'raw' directives (which should
throw NotImplementError for security reasons)
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-07-09 03:57:18 UTC (rev 69052)
+++ Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py 2006-07-09 07:27:11 UTC (rev 69053)
@@ -56,14 +56,26 @@
s = '<h1><a id="hello-world" name="hello-world">Hello World</a></h1>'
self.assertEqual(s in html, True)
- s = '<h1><a id="von-v-geln-und-fen" name="von-v-geln-und-fen">Von Vögeln und Öfen</a></h1>'
+ s = '<h1><a id="von-v-geln-und-fen" 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 testFileInclusion(self):
+ resty = self._makeOne()
+ resty.source = 'hello world\n .. include:: /etc/passwd'
+ self.assertRaises(NotImplementedError, resty.render)
+# disabled test so far until we have a consensus how to deal with 'raw'
+# def testRawPassthrough(self):
+# resty = self._makeOne()
+# resty.source = '.. raw:: html\n\n <h1>HELLO WORLD</h1>'
+# self.assertRaises(NotImplementedError, resty.render)
+
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestZReST))
More information about the Zope-Checkins
mailing list