[Checkins] SVN: zope.app.publication/trunk/ Include the ``notfound.txt`` test again but reduce its scope to functionality relevant to this distribution.

Hanno Schlichting hannosch at hannosch.eu
Tue Sep 14 09:52:46 EDT 2010


Log message for revision 116389:
  Include the ``notfound.txt`` test again but reduce its scope to functionality relevant to this distribution.
  

Changed:
  U   zope.app.publication/trunk/CHANGES.txt
  U   zope.app.publication/trunk/src/zope/app/publication/notfound.txt
  U   zope.app.publication/trunk/src/zope/app/publication/tests/test_functional.py

-=-
Modified: zope.app.publication/trunk/CHANGES.txt
===================================================================
--- zope.app.publication/trunk/CHANGES.txt	2010-09-14 13:52:20 UTC (rev 116388)
+++ zope.app.publication/trunk/CHANGES.txt	2010-09-14 13:52:46 UTC (rev 116389)
@@ -5,10 +5,12 @@
 3.12.0 (unreleased)
 -------------------
 
+- Include the ``notfound.txt`` test again but reduce its scope to functionality
+  relevant to this distribution.
+
 - Notify with IStartRequestEvent at the start of the request publication
   cycle.
 
-
 3.11.1 (2010-04-19)
 -------------------
 

Modified: zope.app.publication/trunk/src/zope/app/publication/notfound.txt
===================================================================
--- zope.app.publication/trunk/src/zope/app/publication/notfound.txt	2010-09-14 13:52:20 UTC (rev 116388)
+++ zope.app.publication/trunk/src/zope/app/publication/notfound.txt	2010-09-14 13:52:46 UTC (rev 116389)
@@ -4,59 +4,11 @@
 Not found errors should only be displayed when someone provides a URL
 to an object that doesn't exist, as in:
 
+  >>> from zope.app.wsgi.testlayer import http
   >>> print http(r"""
   ... GET /eek HTTP/1.1
   ... """)
-  HTTP/1.1 404 Not Found
+  HTTP/1.0 404 Not Found
   ...
-    The page that you are trying to access is not available
+    A server error occurred.
   ...
-
-On the other hand, if we create something that raises an exception
-inside we should get an internal server error:
-
-  >>> 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--
-  ... """)
-  HTTP/1.1 303 See Other
-  ...
-  Location: http://localhost/@@contents.html
-  ...
-
-
-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.
-  ...

Modified: zope.app.publication/trunk/src/zope/app/publication/tests/test_functional.py
===================================================================
--- zope.app.publication/trunk/src/zope/app/publication/tests/test_functional.py	2010-09-14 13:52:20 UTC (rev 116388)
+++ zope.app.publication/trunk/src/zope/app/publication/tests/test_functional.py	2010-09-14 13:52:46 UTC (rev 116389)
@@ -12,8 +12,6 @@
 #
 ##############################################################################
 """Test not found errors
-
-$Id$
 """
 
 import re
@@ -35,6 +33,10 @@
         '../methodnotallowed.txt',
         optionflags=optionflags)
     methodnotallowed.layer = PublicationLayer
+    notfound = doctest.DocFileSuite(
+        '../notfound.txt',
+        optionflags=optionflags)
+    notfound.layer = PublicationLayer
     httpfactory = doctest.DocFileSuite(
         '../httpfactory.txt', checker=checker,
         optionflags=optionflags)
@@ -45,6 +47,7 @@
     site.layer = PublicationLayer
     return unittest.TestSuite((
         methodnotallowed,
+        notfound,
         httpfactory,
         site,))
 



More information about the checkins mailing list