[Checkins] SVN: zope.errorview/trunk/src/zope/errorview/tests/test_http.py demonstrate the traversal exception view will handle NotFound errors too

Jan-Wijbrand Kolman janwijbrand at gmail.com
Wed Jan 19 11:04:13 EST 2011


Log message for revision 119718:
  demonstrate the traversal exception view will handle NotFound errors too

Changed:
  U   zope.errorview/trunk/src/zope/errorview/tests/test_http.py

-=-
Modified: zope.errorview/trunk/src/zope/errorview/tests/test_http.py
===================================================================
--- zope.errorview/trunk/src/zope/errorview/tests/test_http.py	2011-01-19 15:54:02 UTC (rev 119717)
+++ zope.errorview/trunk/src/zope/errorview/tests/test_http.py	2011-01-19 16:04:13 UTC (rev 119718)
@@ -22,7 +22,7 @@
 from zope.publisher.http import HTTPRequest
 from zope.publisher.interfaces.http import IHTTPException, IHTTPRequest
 from zope.publisher.interfaces.http import MethodNotAllowed, IMethodNotAllowed
-from zope.publisher.interfaces import TraversalException
+from zope.publisher.interfaces import TraversalException, NotFound
 from zope.security.interfaces import Unauthorized
 import zope.errorview
 
@@ -119,6 +119,13 @@
         self.assertEqual(self.request.response.getStatus(), 404)
         # XXX test the MKCOL verb here too.
 
+    def test_notfound(self):
+        view = getMultiAdapter(
+            (NotFound(object(), self.request), self.request), name='index.html')
+        self.failUnless(IHTTPException.providedBy(view))
+        self.assertEquals(view(), '')
+        self.assertEqual(self.request.response.getStatus(), 404)
+
     def test_unauthorizedexceptionview(self):
         view = getMultiAdapter(
             (Unauthorized(), self.request), name='index.html')



More information about the checkins mailing list