[Zope3-checkins] CVS: Zope3/src/zope/app/content/tests - test_zptpage.py:1.6
Jim Fulton
jim@zope.com
Sat, 25 Jan 2003 09:48:56 -0500
Update of /cvs-repository/Zope3/src/zope/app/content/tests
In directory cvs.zope.org:/tmp/cvs-serv8046
Modified Files:
test_zptpage.py
Log Message:
Added a test to make sure the request is protected.
=== Zope3/src/zope/app/content/tests/test_zptpage.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/content/tests/test_zptpage.py:1.5 Sat Dec 28 12:49:25 2002
+++ Zope3/src/zope/app/content/tests/test_zptpage.py Sat Jan 25 09:48:52 2003
@@ -20,6 +20,7 @@
import unittest
from zope.interface.verify import verifyClass
+from zope.exceptions import Forbidden
from zope.app.content.zpt import ZPTPage, SearchableText
from zope.app.interfaces.content.zpt import IZPTPage
@@ -90,6 +91,17 @@
'zope'
'</a></body></html>'
)
+
+ def test_request_protected(self):
+ page = ZPTPage()
+ page.setSource(
+ u'<p tal:content="python: request.__dict__" />'
+ )
+
+ page = Wrapper(page, Data(name='zope'))
+
+ self.assertRaises(Forbidden, page.render, Data())
+
class DummyZPT: