[Checkins] SVN: grokcore.xmlrpc/trunk/s temporary fix in the tests; awaits a [zope|grokcore].errorview package. Gets rid of the zope.app.http dependency.
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Tue Jan 18 08:33:00 EST 2011
Log message for revision 119642:
temporary fix in the tests; awaits a [zope|grokcore].errorview package. Gets rid of the zope.app.http dependency.
Changed:
U grokcore.xmlrpc/trunk/setup.py
U grokcore.xmlrpc/trunk/src/grokcore/xmlrpc/ftesting.zcml
U grokcore.xmlrpc/trunk/src/grokcore/xmlrpc/ftests/xmlrpc/require.py
-=-
Modified: grokcore.xmlrpc/trunk/setup.py
===================================================================
--- grokcore.xmlrpc/trunk/setup.py 2011-01-18 13:06:32 UTC (rev 119641)
+++ grokcore.xmlrpc/trunk/setup.py 2011-01-18 13:33:00 UTC (rev 119642)
@@ -18,7 +18,7 @@
'grokcore.view [security_publication]',
'zope.app.wsgi',
'zope.app.appsetup',
- 'zope.app.http',
+# 'zope.app.http',
'zope.testing',
]
Modified: grokcore.xmlrpc/trunk/src/grokcore/xmlrpc/ftesting.zcml
===================================================================
--- grokcore.xmlrpc/trunk/src/grokcore/xmlrpc/ftesting.zcml 2011-01-18 13:06:32 UTC (rev 119641)
+++ grokcore.xmlrpc/trunk/src/grokcore/xmlrpc/ftesting.zcml 2011-01-18 13:33:00 UTC (rev 119642)
@@ -9,7 +9,7 @@
<include package="grokcore.xmlrpc" />
<include package="grokcore.traverser" />
<include package="grokcore.view" file="publication_security.zcml" />
- <include package="zope.app.http.exception" />
+
<grok:grok package=".ftests" />
</configure>
Modified: grokcore.xmlrpc/trunk/src/grokcore/xmlrpc/ftests/xmlrpc/require.py
===================================================================
--- grokcore.xmlrpc/trunk/src/grokcore/xmlrpc/ftests/xmlrpc/require.py 2011-01-18 13:06:32 UTC (rev 119641)
+++ grokcore.xmlrpc/trunk/src/grokcore/xmlrpc/ftests/xmlrpc/require.py 2011-01-18 13:33:00 UTC (rev 119642)
@@ -9,6 +9,29 @@
>>> print server.stomp()
Manfred stomped.
+XXX temporarily register a view for Unauthorized exceptions, awaiting a
+[zope|grokcore].errorview package.
+
+ >>> from zope.interface import implements
+ >>> from zope.component import provideAdapter
+ >>> from zope.security.interfaces import IUnauthorized
+ >>> from zope.publisher.interfaces.http import IHTTPRequest, IHTTPException
+ >>> class Unauthorized(object):
+ ... implements(IHTTPException)
+ ... def __init__(self, context, request):
+ ... self.context = context
+ ... self.request = request
+ ... def __call__(self):
+ ... self.request.unauthorized('basic realm="Zope"')
+ ... return ''
+ ... __str__ = __call__
+ >>> provideAdapter(
+ ... Unauthorized, adapts=(IUnauthorized, IHTTPRequest), name='index.html')
+ >>> from zope.publisher.interfaces import IDefaultViewName
+ >>> provideAdapter(
+ ... 'index.html', adapts=(IUnauthorized, IHTTPRequest),
+ ... provides=IDefaultViewName)
+
>>> print server.dance()
Traceback (most recent call last):
ProtocolError: <ProtocolError for localhost/: 401 401 Unauthorized>
More information about the checkins
mailing list