[Checkins] SVN: zope.app.exception/trunk/ No longer depend on ``zope.app.zptpage`` for tests.

Michael Howitz mh at gocept.com
Tue Sep 14 08:47:32 EDT 2010


Log message for revision 116380:
  No longer depend on ``zope.app.zptpage`` for tests.

Changed:
  U   zope.app.exception/trunk/CHANGES.txt
  U   zope.app.exception/trunk/setup.py
  U   zope.app.exception/trunk/src/zope/app/exception/browser/systemerror.txt
  U   zope.app.exception/trunk/src/zope/app/exception/browser/tests/test_error.py
  U   zope.app.exception/trunk/src/zope/app/exception/ftesting.zcml

-=-
Modified: zope.app.exception/trunk/CHANGES.txt
===================================================================
--- zope.app.exception/trunk/CHANGES.txt	2010-09-14 12:46:57 UTC (rev 116379)
+++ zope.app.exception/trunk/CHANGES.txt	2010-09-14 12:47:31 UTC (rev 116380)
@@ -4,7 +4,7 @@
 3.6.2 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- No longer depend on ``zope.app.zptpage`` for tests.
 
 
 3.6.1 (2010-01-08)

Modified: zope.app.exception/trunk/setup.py
===================================================================
--- zope.app.exception/trunk/setup.py	2010-09-14 12:46:57 UTC (rev 116379)
+++ zope.app.exception/trunk/setup.py	2010-09-14 12:47:31 UTC (rev 116380)
@@ -62,7 +62,6 @@
           'zope.app.securitypolicy',
           'zope.app.testing',
           'zope.app.zcmlfiles',
-          'zope.app.zptpage',
           'zope.login',
       ]),
       install_requires=['setuptools',

Modified: zope.app.exception/trunk/src/zope/app/exception/browser/systemerror.txt
===================================================================
--- zope.app.exception/trunk/src/zope/app/exception/browser/systemerror.txt	2010-09-14 12:46:57 UTC (rev 116379)
+++ zope.app.exception/trunk/src/zope/app/exception/browser/systemerror.txt	2010-09-14 12:47:31 UTC (rev 116380)
@@ -9,51 +9,12 @@
 Zope provides a default system error view that prints an obnoxius
 terse message and that sets the response status.
 
-To see an example of this, we'll create a ZPT page with an intentional
-error:
+There is a simple view registered in ``ftesting.zcml`` which raises
+``Exception()``:
 
   >>> print http(r"""
-  ... POST /+/zope.app.zptpage.ZPTPage%3D HTTP/1.1
-  ... Authorization: Basic mgr:mgrpw
-  ... Content-Length: 739
-  ... Content-Type: multipart/form-data; boundary=---------------------------125598457818223697821067764270
-  ... Referer: http://localhost:8081/+/zope.app.zptpage.ZPTPage=
-  ...
-  ... -----------------------------125598457818223697821067764270
-  ... Content-Disposition: form-data; name="field.source"
-  ...
-  ... <html><body tal:content="container/eek" /></html>
-  ... -----------------------------125598457818223697821067764270
-  ... Content-Disposition: form-data; name="field.expand.used"
-  ...
-  ...
-  ... -----------------------------125598457818223697821067764270
-  ... Content-Disposition: form-data; name="field.evaluateInlineCode.used"
-  ...
-  ...
-  ... -----------------------------125598457818223697821067764270
-  ... Content-Disposition: form-data; name="UPDATE_SUBMIT"
-  ...
-  ... Add
-  ... -----------------------------125598457818223697821067764270
-  ... Content-Disposition: form-data; name="add_input_name"
-  ...
-  ... test.html
-  ... -----------------------------125598457818223697821067764270--
+  ... GET /error.html HTTP/1.1
   ... """)
-  HTTP/1.1 303 See Other
-  ...
-  Location: http://localhost/@@contents.html
-  ...
-
-When we visit it, we get a terse error and a 500 status:
-
-We get a system error, because the problem is in the template, not in
-the URL:
-
-  >>> print http(r"""
-  ... GET /test.html HTTP/1.1
-  ... """)
   HTTP/1.1 500 Internal Server Error
   ...
     A system error occurred.
@@ -61,7 +22,7 @@
 
 Another way of getting a system error is the occurrence of a system
 error, such as ``ComponentLookupError``. I have registered a simple
-view in ``exception-ftesting.zcml`` that will raise a component lookup
+view in ``ftesting.zcml``, too, that will raise a component lookup
 error. So if we call ``componentlookuperror.html``, we should get the
 error message:
 

Modified: zope.app.exception/trunk/src/zope/app/exception/browser/tests/test_error.py
===================================================================
--- zope.app.exception/trunk/src/zope/app/exception/browser/tests/test_error.py	2010-09-14 12:46:57 UTC (rev 116379)
+++ zope.app.exception/trunk/src/zope/app/exception/browser/tests/test_error.py	2010-09-14 12:47:31 UTC (rev 116380)
@@ -20,6 +20,12 @@
 from zope.component.interfaces import ComponentLookupError
 from zope.app.exception.testing import AppExceptionLayer
 
+class RaiseError(object):
+
+    def __call__(self):
+        raise Exception()
+
+
 class RaiseComponentLookupError(object):
 
     def __call__(self):
@@ -45,6 +51,3 @@
         unittest.makeSuite(TestComponentLookupError),
         systemerror,
         ))
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')

Modified: zope.app.exception/trunk/src/zope/app/exception/ftesting.zcml
===================================================================
--- zope.app.exception/trunk/src/zope/app/exception/ftesting.zcml	2010-09-14 12:46:57 UTC (rev 116379)
+++ zope.app.exception/trunk/src/zope/app/exception/ftesting.zcml	2010-09-14 12:47:31 UTC (rev 116380)
@@ -12,12 +12,18 @@
 
   <include package="zope.app.zcmlfiles" />
   <include package="zope.app.authentication" />
-  <include package="zope.app.zptpage"/>
   <include package="zope.app.securitypolicy" />
   <include package="zope.login" />
 
   <browser:page
       for="zope.app.folder.interfaces.IFolder"
+      name="error.html"
+      class="zope.app.exception.browser.tests.test_error.RaiseError"
+      permission="zope.Public"
+      />
+
+  <browser:page
+      for="zope.app.folder.interfaces.IFolder"
       name="componentlookuperror.html"
       class="zope.app.exception.browser.tests.test_error.RaiseComponentLookupError"
       permission="zope.Public"



More information about the checkins mailing list