Commit f0739b2a authored by Chris McDonough's avatar Chris McDonough

The stringio return value is used during recursion, the deleted test asserted

the wrong thing.
parent 61002ca7
...@@ -479,7 +479,7 @@ class Unlock: ...@@ -479,7 +479,7 @@ class Unlock:
uri = urljoin(url, absattr(ob.getId())) uri = urljoin(url, absattr(ob.getId()))
self.apply(ob, token, uri, result, top=0) self.apply(ob, token, uri, result, top=0)
if not top: if not top:
return result.getvalue() return result
if result.getvalue(): if result.getvalue():
# One or more subitems probably failed, so close the multistatus # One or more subitems probably failed, so close the multistatus
# element and clear out all succesful unlocks # element and clear out all succesful unlocks
......
...@@ -21,19 +21,6 @@ class TestUnlock(unittest.TestCase): ...@@ -21,19 +21,6 @@ class TestUnlock(unittest.TestCase):
return self.token == token return self.token == token
return Lockable(locktoken) return Lockable(locktoken)
def test_apply_nontop_resource_returns_string(self):
""" When top=0 in unlock constructor, prior to Zope 2.11, the
unlock.apply method would return a StringIO. This was bogus
because a StringIO cannot be used as a response body via the
standard RESPONSE.setBody() command. Only strings or objects
with an asHTML method may be passed into setBody()."""
inst = self._makeOne()
lockable = self._makeLockable(None)
result = inst.apply(lockable, 'bogus',
url='http://example.com/foo/UNLOCK', top=0)
self.failUnless(isinstance(result, str))
def test_apply_bogus_lock(self): def test_apply_bogus_lock(self):
""" """
When attempting to unlock a resource with a token that the When attempting to unlock a resource with a token that the
...@@ -52,6 +39,7 @@ class TestUnlock(unittest.TestCase): ...@@ -52,6 +39,7 @@ class TestUnlock(unittest.TestCase):
lockable = self._makeLockable(None) lockable = self._makeLockable(None)
result = inst.apply(lockable, 'bogus', result = inst.apply(lockable, 'bogus',
url='http://example.com/foo/UNLOCK', top=0) url='http://example.com/foo/UNLOCK', top=0)
result = result.getvalue()
self.assertNotEqual( self.assertNotEqual(
result.find('<d:status>HTTP/1.1 400 Bad Request</d:status>'), result.find('<d:status>HTTP/1.1 400 Bad Request</d:status>'),
-1) -1)
......
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