[Checkins] SVN: z3c.layer.ready2go/trunk/ - adjust dependencies, skip dependency on zope.app.publisher and zope.app.http
Roger Ineichen
roger at projekt01.ch
Tue Dec 1 04:07:58 EST 2009
Log message for revision 106135:
- adjust dependencies, skip dependency on zope.app.publisher and zope.app.http
and reflect changes in zope packages
- added more tests
Changed:
U z3c.layer.ready2go/trunk/CHANGES.txt
U z3c.layer.ready2go/trunk/setup.py
U z3c.layer.ready2go/trunk/src/z3c/layer/ready2go/README.txt
U z3c.layer.ready2go/trunk/src/z3c/layer/ready2go/ftesting.zcml
-=-
Modified: z3c.layer.ready2go/trunk/CHANGES.txt
===================================================================
--- z3c.layer.ready2go/trunk/CHANGES.txt 2009-11-30 23:21:51 UTC (rev 106134)
+++ z3c.layer.ready2go/trunk/CHANGES.txt 2009-12-01 09:07:58 UTC (rev 106135)
@@ -2,11 +2,14 @@
CHANGES
=======
-0.5.4 (unreleased)
+0.6.0 (2009-12-01)
------------------
-- ...
+- adjust dependencies, skip dependency on zope.app.publisher and zope.app.http
+ and reflect changes in zope packages
+
+
0.5.3 (2009-07-24)
------------------
Modified: z3c.layer.ready2go/trunk/setup.py
===================================================================
--- z3c.layer.ready2go/trunk/setup.py 2009-11-30 23:21:51 UTC (rev 106134)
+++ z3c.layer.ready2go/trunk/setup.py 2009-12-01 09:07:58 UTC (rev 106135)
@@ -21,11 +21,10 @@
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-version = '0.5.4dev'
setup (
name='z3c.layer.ready2go',
- version=version,
+ version='0.6.0',
author="Stephan Richter, Roger Ineichen and the Zope Community",
author_email = "zope-dev at zope.org",
description = "A ready to go layer for Zope3",
@@ -58,27 +57,22 @@
extras_require = dict(
test = [
'zope.testbrowser',
- 'zope.app.securitypolicy',
+ 'zope.app.authentication',
'zope.app.testing',
- 'zope.app.zcmlfiles',
- 'zope.app.twisted',
- 'zope.app.session',
- 'z3c.form [test]',
+ 'zope.browserresource',
+ 'zope.principalregistry',
+ 'zope.publisher',
+ 'zope.security',
+ 'zope.securitypolicy',
+ 'zope.testing',
],
),
install_requires = [
'setuptools',
- 'zope.configuration',
- 'zope.traversing',
- 'zope.app.http',
- 'zope.app.publisher',
'z3c.form',
'z3c.formui',
- 'z3c.pagelet',
- 'zope.viewlet',
'z3c.layer.pagelet',
- 'z3c.form',
- 'z3c.formui',
+ 'zope.viewlet',
],
zip_safe = False,
)
Modified: z3c.layer.ready2go/trunk/src/z3c/layer/ready2go/README.txt
===================================================================
--- z3c.layer.ready2go/trunk/src/z3c/layer/ready2go/README.txt 2009-11-30 23:21:51 UTC (rev 106134)
+++ z3c.layer.ready2go/trunk/src/z3c/layer/ready2go/README.txt 2009-12-01 09:07:58 UTC (rev 106135)
@@ -40,8 +40,6 @@
Check if we can access the ``page.html`` view which is registred in the
``ftesting.zcml`` file with our skin:
- >>> manager = Browser()
- >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
>>> skinURL = 'http://localhost/++skin++Ready2GoTestSkin'
>>> manager.open(skinURL + '/page.html')
>>> manager.url
@@ -67,6 +65,10 @@
</html>
<BLANKLINE>
+
+Not Found
+~~~~~~~~~
+
Now check the not found page which is a exception view on the exception
``zope.publisher.interfaces.INotFound``:
@@ -109,6 +111,10 @@
</html>
<BLANKLINE>
+
+User error
+~~~~~~~~~~
+
And check the user error page which is a view registred for
``zope.exceptions.interfaces.IUserError`` exceptions:
@@ -128,6 +134,10 @@
</html>
<BLANKLINE>
+
+Common exception (system error)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
And check error view registred for
``zope.interface.common.interfaces.IException``:
@@ -154,8 +164,12 @@
</html>
<BLANKLINE>
+
+Forbidden 403
+~~~~~~~~~~~~~
+
And check the ``zope.security.interfaces.IUnauthorized`` view, use a new
-unregistred user (test browser) for this:
+unregistred user (test browser) for this.
>>> unauthorized = Browser()
>>> unauthorized.open(skinURL + '/@@forbidden.html')
@@ -182,7 +196,63 @@
</html>
<BLANKLINE>
+As you can see, this test will return a 403 Forbidden error. But this is only
+because we do not have an unauthenticated principal available. See the test
+below what happens if we register an unauthenticated princiapl.
+
+Unauthorized 401
+~~~~~~~~~~~~~~~~
+
+If we use an authenticated principal and access the forbitten page, we will get
+a 401 Unauthorized instead of a 403 Forbidden error page.
+
+ >>> from zope.configuration import xmlconfig
+ >>> import zope.principalregistry
+ >>> def zcml(s):
+ ... context = xmlconfig.file('meta.zcml', zope.principalregistry)
+ ... xmlconfig.string(s, context)
+
+ >>> zcml("""
+ ... <configure
+ ... xmlns="http://namespaces.zope.org/zope"
+ ... >
+ ...
+ ... <unauthenticatedPrincipal
+ ... id="zope.unknown"
+ ... title="Anonymous user"
+ ... description="A person we don't know"
+ ... />
+ ...
+ ... </configure>
+ ... """)
+
+ >>> manager = Browser()
+ >>> manager.open(skinURL + '/@@forbidden.html')
+ Traceback (most recent call last):
+ ...
+ HTTPError: HTTP Error 401: Unauthorized
+
+ >>> print unauthorized.contents
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>PageletTestLayout</title>
+ </head>
+ <body>
+ <div>
+ <br />
+ <br />
+ <h3>Unauthorized</h3>
+ <br />
+ <b>You are not authorized.</b>
+ </div>
+ <BLANKLINE>
+ </body>
+ </html>
+ <BLANKLINE>
+
+
Form and form layout support
----------------------------
@@ -364,16 +434,18 @@
>>> from zope.configuration import xmlconfig
>>> import zope.component
+ >>> import zope.security
>>> import zope.viewlet
- >>> import zope.app.component
- >>> import zope.app.publisher.browser
+ >>> import zope.browserpage
+ >>> import zope.browserresource
>>> import z3c.macro
>>> import z3c.template
>>> import z3c.formui
+ >>> xmlconfig.XMLConfig('meta.zcml', zope.browserpage)()
+ >>> xmlconfig.XMLConfig('meta.zcml', zope.browserresource)()
>>> xmlconfig.XMLConfig('meta.zcml', zope.component)()
+ >>> xmlconfig.XMLConfig('meta.zcml', zope.security)()
>>> xmlconfig.XMLConfig('meta.zcml', zope.viewlet)()
- >>> xmlconfig.XMLConfig('meta.zcml', zope.app.component)()
- >>> xmlconfig.XMLConfig('meta.zcml', zope.app.publisher.browser)()
>>> xmlconfig.XMLConfig('meta.zcml', z3c.macro)()
>>> xmlconfig.XMLConfig('meta.zcml', z3c.template)()
>>> xmlconfig.XMLConfig('configure.zcml', z3c.formui)()
Modified: z3c.layer.ready2go/trunk/src/z3c/layer/ready2go/ftesting.zcml
===================================================================
--- z3c.layer.ready2go/trunk/src/z3c/layer/ready2go/ftesting.zcml 2009-11-30 23:21:51 UTC (rev 106134)
+++ z3c.layer.ready2go/trunk/src/z3c/layer/ready2go/ftesting.zcml 2009-12-01 09:07:58 UTC (rev 106135)
@@ -15,63 +15,54 @@
<exclude package="zope.app.authentication.browser" file="httpplugins.zcml" />
<exclude package="zope.app.authentication.browser" file="principalfolder.zcml" />
<exclude package="zope.app.authentication.browser" file="session.zcml" />
- <exclude package="zope.app.broken" file="browser.zcml" />
- <exclude package="zope.app.container.browser" />
- <exclude package="zope.app.error.browser" />
- <exclude package="zope.app.folder.browser" />
- <exclude package="zope.app.i18n.browser" />
- <exclude package="zope.app.securitypolicy.browser" />
- <exclude package="zope.app.session" file="browser.zcml" />
- <exclude package="zope.dublincore.browser" />
+
<!-- meta configure -->
- <include package="zope.i18n" file="meta.zcml" />
- <include package="zope.app.component" file="meta.zcml" />
<include package="zope.app.pagetemplate" file="meta.zcml" />
<include package="zope.app.publication" file="meta.zcml" />
- <include package="zope.app.publisher" file="meta.zcml" />
- <include package="zope.app.security" file="meta.zcml" />
+ <include package="zope.browserpage" file="meta.zcml" />
+ <include package="zope.browserresource" file="meta.zcml" />
+ <include package="zope.component" file="meta.zcml" />
+ <include package="zope.i18n" file="meta.zcml" />
+ <include package="zope.principalregistry" file="meta.zcml" />
+ <include package="zope.publisher" file="meta.zcml" />
+ <include package="zope.security" file="meta.zcml" />
<include package="zope.securitypolicy" file="meta.zcml" />
<include package="zope.viewlet" file="meta.zcml" />
<!-- 3rd party meta configure -->
+ <include package="z3c.form" file="meta.zcml" />
+ <include package="z3c.macro" file="meta.zcml" />
<include package="z3c.pagelet" file="meta.zcml" />
<include package="z3c.template" file="meta.zcml" />
- <include package="z3c.macro" file="meta.zcml" />
- <include package="z3c.form" file="meta.zcml" />
<!-- zope core component -->
<include package="zope.annotation" />
<include package="zope.app.appsetup" />
- <include package="zope.app.component" />
- <include package="zope.app.container" />
- <include package="zope.app.error" />
- <include package="zope.app.http.exception" />
- <include package="zope.app.i18n" />
+ <include package="zope.app.authentication" />
<include package="zope.app.publication" />
- <include package="zope.app.publisher.browser" />
- <include package="zope.app.security" />
- <include package="zope.app.securitypolicy" />
- <include package="zope.app.session" />
- <include package="zope.app.twisted" />
- <include package="zope.app.wsgi" />
+ <include package="zope.authentication" />
<include package="zope.component" />
+ <include package="zope.container" />
<include package="zope.contentprovider" />
<include package="zope.location" />
+ <include package="zope.principalregistry" />
<include package="zope.publisher" />
+ <include package="zope.security" file="permissions.zcml" />
+ <include package="zope.securitypolicy" />
+ <include package="zope.session" />
+ <include package="zope.site" />
<include package="zope.traversing" />
- <include package="zope.traversing.browser" />
- <include package="zope.viewlet" />
<!-- z3c component -->
- <include package="z3c.pagelet" />
- <include package="z3c.layer.pagelet" />
- <include package="z3c.macro" />
<include package="z3c.form" />
<include package="z3c.formui" />
+ <include package="z3c.layer.pagelet" />
+ <include package="z3c.macro" />
+ <include package="z3c.pagelet" />
<!-- test pages taken from z3c.layer.pagelet package -->
More information about the checkins
mailing list