[Zope3-checkins]
SVN: Zope3/branches/srichter-blow-services/src/zope/app/
Fixed absoluteURL related test bug.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Jan 12 11:39:33 EST 2005
Log message for revision 28808:
Fixed absoluteURL related test bug.
Changed:
U Zope3/branches/srichter-blow-services/src/zope/app/container/browser/tests/test_adding.py
U Zope3/branches/srichter-blow-services/src/zope/app/presentation/presentation.py
-=-
Modified: Zope3/branches/srichter-blow-services/src/zope/app/container/browser/tests/test_adding.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/container/browser/tests/test_adding.py 2005-01-12 16:19:27 UTC (rev 28807)
+++ Zope3/branches/srichter-blow-services/src/zope/app/container/browser/tests/test_adding.py 2005-01-12 16:39:33 UTC (rev 28808)
@@ -31,6 +31,7 @@
from zope.app.testing import ztapi
from zope.app.testing.placelesssetup import PlacelessSetup, setUp, tearDown
from zope.app.traversing.browser import AbsoluteURL
+from zope.app.traversing.browser.interfaces import IAbsoluteURL
from zope.app.traversing.interfaces import IContainmentRoot
from zope.app.exception.interfaces import UserError
from zope.app.publisher.browser import BrowserView
@@ -84,6 +85,8 @@
url += '/' + name
return url
+ __call__ = __str__
+
def defineMenuItem(menuItemType, for_, action, title=u'', extra=None):
newclass = type(title, (BrowserMenuItem,),
{'title':title, 'action':action,
@@ -182,6 +185,7 @@
adding.__name__ = '+'
ztapi.browserView(IAdding, "Thing", CreationView)
ztapi.browserView(Interface, "absolute_url", AbsoluteURL)
+ ztapi.browserView(None, '', AbsoluteURL, providing=IAbsoluteURL)
self.assertRaises(UserError, adding.action, '', 'foo')
adding.action('Thing', 'foo')
self.assertEqual(adding.request.response._headers['location'],
Modified: Zope3/branches/srichter-blow-services/src/zope/app/presentation/presentation.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/presentation/presentation.py 2005-01-12 16:19:27 UTC (rev 28807)
+++ Zope3/branches/srichter-blow-services/src/zope/app/presentation/presentation.py 2005-01-12 16:39:33 UTC (rev 28808)
@@ -285,19 +285,14 @@
objectpath = zapi.getPath(self)
dependents.removeDependent(objectpath)
-# TODO: Make this a new-style class. This is not easily possible
-# because existing databases apparently contain references to
-# instances of this class; probably because of a difference in the
-# pickling protocol, we get an UnpicklingError if we simply make this
-# a newstyle class.
class TemplateViewFactory(object):
def __init__(self, cls, template, permission):
self.cls, self.template, self.permission = cls, template, permission
- # XXX Trap code that uses 'Permissions' vocabulary instead of
- # 'Permission Ids'. This check should go away once the mess
- # with permissions is straigthened up.
+ # TODO Trap code that uses 'Permissions' vocabulary instead of
+ # 'Permission Ids'. This check should go away once the mess
+ # with permissions is straigthened up.
from zope.app.security.permission import Permission
if isinstance(permission, Permission):
raise TypeError('permission should be a string or CheckerPublic,'
More information about the Zope3-Checkins
mailing list