Package: z3c.layer.minimal
This package provides a minimal layer setup for Zope3.ContentsMinimal Browser Layer for Zope 3IMinimalBrowserLayerInterfaceTestingCHANGES1.2.1 (2009-06-19)1.2.0 (2009-02-21)1.1.0 (2009-02-19)1.0.1 (2008-01-24)1.0.0 (2008-01-21)0.2.3 (2007-11-07)0.2.2 (2007-10-31)0.2.1 (2007-??-??)0.2.0 (2007-??-??)Minimal Browser Layer for Zope 3This package contains the minimal layer. This layer supports a correct set of
component registration and can be used for inheritation in custom skins.Right now the default implementation in Zope3 has different restriction in the
traversal concept and use to much registration on the default layer.IMinimalBrowserLayerInterfaceThe minimal layer is useful for build custom presentation skins without access
to ZMI menus likezmi_viewsetc. This means there is no menu item registred
if you use this layer.This layer is NOT derived fromIDefaultBrowserLayer. Therefore it provides
only a minimal set of the most important public views such as@@absolute_url.  The following packages are accounted:zope.app.http.exceptionzope.app.publicationzope.app.publisher.browserzope.app.traversingzope.app.traversing.browserTestingFor testing theIMinimalBrowserLayerlayer we use the testing skin defined
in the tests package which uses theIMinimalBrowserLayerlayer as the only
base layer.  This means, that our testing skin provides only the views defined
in the minimal package and it’s testing views defined in tests.Login as manager first:>>> from zope.testbrowser.testing import Browser
>>> manager = Browser()
>>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')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++MinimalTesting'
>>> manager.open(skinURL + '/page.html')
>>> manager.url
'http://localhost/++skin++MinimalTesting/page.html'>>> print manager.contents
<BLANKLINE>
<html>
<head>
  <title>testing</title>
</head>
<body>
<BLANKLINE>
  test page
<BLANKLINE>
</body>
</html>
<BLANKLINE>
<BLANKLINE>Now check the not found page which is a exception view on the exceptionzope.publisher.interfaces.INotFound:>>> manager.open(skinURL + '/foobar.html')
Traceback (most recent call last):
...
HTTPError: HTTP Error 404: Not Found>>> print manager.contents
<BLANKLINE>
<html>
<head>
  <title>testing</title>
</head>
<body>
<div>
  <br />
  <br />
  <h3>
    The page you are trying to access is not available
  </h3>
  <br />
  <b>
    Please try the following:
  </b>
  <br />
  <ol>
    <li>
      Make sure that the Web site address is spelled correctly.
    </li>
    <li>
      <a href="javascript:history.back(1);">
        Go back and try another URL.
      </a>
    </li>
  </ol>
</div>
</body>
</html>
<BLANKLINE>
<BLANKLINE>And check the user error page which is a view registred forzope.exceptions.interfaces.IUserErrorexceptions:>>> manager.open(skinURL + '/@@usererror.html')
>>> print manager.contents
<BLANKLINE>
<html>
<head>
  <title>testing</title>
</head>
<body>
<div>
  <div>simply user error</div>
</div>
</body>
</html>
<BLANKLINE>
<BLANKLINE>And check error view registred forzope.interface.common.interfaces.IException:>>> manager.open(skinURL + '/@@systemerror.html')
>>> print manager.contents
<BLANKLINE>
<html>
<head>
  <title>testing</title>
</head>
<body>
<div>
  <br />
  <br />
  <h3>A system error occurred</h3>
  <br />
  <b>Please contact the administrator.</b>
  <a href="javascript:history.back(1);">
    Go back and try another URL.
  </a>
</div>
</body>
</html>
<BLANKLINE>
<BLANKLINE>And check thezope.security.interfaces.IUnauthorizedview, use a new
unregistred user (test browser) for this:>>> unauthorized = Browser()
>>> unauthorized.open(skinURL + '/@@forbidden.html')
Traceback (most recent call last):
...
HTTPError: HTTP Error 401: Unauthorized>>> print unauthorized.contents
<BLANKLINE>
<html>
<head>
  <title>testing</title>
</head>
<body>
<div>
<BLANKLINE>
<h1>Unauthorized</h1>
<BLANKLINE>
<p>You are not authorized</p>
<BLANKLINE>
</div>
</body>
</html>
<BLANKLINE>
<BLANKLINE>CHANGES1.2.1 (2009-06-19)Remove the zcml slug file and the SETUP.cfg file for zpkg.Added missing dependency onzope.app.exception.1.2.0 (2009-02-21)Security issue:The traverser defined forIMinimalBrowserLayerwas a trusted adapter, so the security
proxy got removed from each traversed object. Thus all sub-objects
were publically accessable, too.1.1.0 (2009-02-19)Fixed dependency warning about ISite.Fixed tests to work with newer zope.testbrowser.Usingzope.containerinstead ofzope.app.container.Made sure that long_description renders properly on pypi.1.0.1 (2008-01-24)Bug: Improved meta-data.1.0.0 (2008-01-21)Restructure: Movez3c.layer.minimalpackage to it’s own top level
package fromz3c.layertoz3c.layer.minimal.0.2.3 (2007-11-07)Forward-Bug: Due to a bug in mechanize, the testbrowser throwshttperror_seek_wrapperinstead ofHTTPErrorerrors. Thanks to RE
normalizers, the code will now work whether the bug is fixed or not in
mechanize.0.2.2 (2007-10-31)Bug: Fixed package meta-data.Bug: Fixed test failures due to depency updates.Restructure: Fixed deprecation warninf forZopeSecurityPolicy.0.2.1 (2007-??-??)Changes unknown.0.2.0 (2007-??-??)Initial release.