[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL/tests - testAbsoluteURL.py:1.1.2.5
Jim Fulton
jim@zope.com
Thu, 23 May 2002 14:01:50 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL/tests
In directory cvs.zope.org:/tmp/cvs-serv26429/lib/python/Zope/App/ZopePublication/AbsoluteURL/tests
Modified Files:
Tag: Zope-3x-branch
testAbsoluteURL.py
Log Message:
This all started with wanting to be able to use url;view in a ZPT path. :)
That lead me to:
- Massive traversal refactoring.
Namespace handling is now centralized in Zope.App.Traversing.
- ZPT refactoring, including some renaming that touches pretty much everything. :)
- The application specific ZPT support was moved into
Zope.App.PageTemplate.
- To get page template files (for use in views):
from Zope.App.PageTemplate import ViewPageTemplateFile
- Fixed up security so that ZPT expressions only have access to
safe builtins and so that modules namespace does imports safely.
- Got ZPTPage working!
- renaming url to absolute_url and got absolute_url to work in paths.
- Cleaned up the (as yet unused) RestrictedInterpreter module in
Zope.Security. In particular, changed to use a separate
RestrictedBuiltins module.
=== Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL/tests/testAbsoluteURL.py 1.1.2.4 => 1.1.2.5 ===
import AbsoluteURL, SiteAbsoluteURL
provideView=getService(None,"Views").provideView
- provideView(None, 'url', IBrowserPublisher, AbsoluteURL)
- provideView(IRoot, 'url', IBrowserPublisher, SiteAbsoluteURL)
+ provideView(None, 'absolute_url', IBrowserPublisher, AbsoluteURL)
+ provideView(IRoot, 'absolute_url', IBrowserPublisher, SiteAbsoluteURL)
def testBadObject(self):
request = TestRequest()
request.setViewType(IBrowserPublisher)
- view = getRequestView(None, 'url', request)
+ view = getRequestView(None, 'absolute_url', request)
self.assertRaises(TypeError, view.__str__)
def testNoContext(self):
request = TestRequest()
request.setViewType(IBrowserPublisher)
- view = getRequestView(Root(), 'url', request)
+ view = getRequestView(Root(), 'absolute_url', request)
self.assertEqual(str(view), 'http://foobar.com')
def testBasicContext(self):
@@ -60,7 +60,7 @@
content = ContextWrapper(object(), Root(), name='a')
content = ContextWrapper(object(), content, name='b')
content = ContextWrapper(object(), content, name='c')
- view = getRequestView(content, 'url', request)
+ view = getRequestView(content, 'absolute_url', request)
self.assertEqual(str(view), 'http://foobar.com/a/b/c')
def test_suite():