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)) _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins