Commit 4a76b01d authored by Stefan H. Holek's avatar Stefan H. Holek

Functional.publish() would hang if it got a request_method argument other

than GET or HEAD while omitting the stdin argument.
parent 2884c777
Unreleased
- Functional.publish() would hang if it got a request_method argument other
than GET or HEAD while omitting the stdin argument.
0.9.8 (Zope 2.8 edition)
- Renamed 'doctest' package to 'zopedoctest' because of name-shadowing
issues discovered during integration into Zope 2.8. Tests may still use
......
......@@ -72,7 +72,7 @@ class Functional(sandbox.Sandboxed):
env['HTTP_AUTHORIZATION'] = "Basic %s" % base64.encodestring(basic)
if stdin is None:
stdin = sys.stdin
stdin = StringIO()
outstream = StringIO()
response = Response(stdout=outstream, stderr=sys.stderr)
......
......@@ -164,6 +164,32 @@ class TestFunctional(ZopeTestCase.FunctionalTestCase):
self.assertEqual(self.folder.new_document.meta_type, 'DTML Document')
self.assertEqual(self.folder.new_document(), 'foo')
def testPUTEmpty(self):
# PUT operation without passing stdin should result in empty content
self.setPermissions([change_dtml_documents])
response = self.publish(self.folder_path+'/index_html',
request_method='PUT',
basic=self.basic_auth)
self.assertEqual(response.getStatus(), 204)
self.assertEqual(self.folder.index_html(), '')
def testPROPFIND(self):
# PROPFIND should work without passing stdin
response = self.publish(self.folder_path+'/index_html',
request_method='PROPFIND',
basic=self.basic_auth)
self.assertEqual(response.getStatus(), 207)
def testHEAD(self):
# HEAD should work without passing stdin
response = self.publish(self.folder_path+'/index_html',
request_method='HEAD')
self.assertEqual(response.getStatus(), 200)
def testSecurityContext(self):
# The authenticated user should not change as a result of publish
self.assertEqual(getSecurityManager().getUser().getId(), user_name)
......
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