Commit f9ec7b97 authored by Andreas Jung's avatar Andreas Jung

parent 1b3109aa
......@@ -25,6 +25,8 @@ Zope Changes
- Collector #2073: fixed misbehaviour of OFS.Owned.changeOwnership
- Collector #1944: HTTPRequest.resolve_url has error in raising errors
Zope 2.8.7 (2007/05/29)
Features added:
......
......@@ -1039,7 +1039,7 @@ class HTTPRequest(BaseRequest):
except: rsp.exception()
if object is None:
req.close()
raise rsp.errmsg, sys.exc_info()[1]
raise sys.exc_info()[0], rsp.errmsg
# The traversal machinery may return a "default object"
# like an index_html document. This is not appropriate
......
......@@ -649,6 +649,18 @@ class ProcessInputsTests(unittest.TestCase):
self.assertEquals(req.cookies['hmm'], '')
self.assertEquals(req.cookies['baz'], 'gee')
def testResolveUrl(self):
# Check that ResolveUrl really raises the same error
# it received from ZPublisher.BaseRequest.traverse
# collector entry 1944
from ZPublisher.HTTPRequest import HTTPRequest
from zExceptions import NotFound
env = TEST_ENVIRON.copy()
req = HTTPRequest(None, env, None)
req['PARENTS'] = ['Nobody', 'cares', 'here']
testmethod = req.resolve_url
self.assertRaises(NotFound, testmethod, 'http://localhost/does_not_exist')
TEST_ENVIRON = {
'CONTENT_TYPE': 'multipart/form-data; boundary=12345',
'REQUEST_METHOD': 'POST',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment