Commit 03d1d69b authored by Casey Duncan's avatar Casey Duncan

Remove unused local assignment

Add test for upward traversal
parent d131f572
...@@ -121,6 +121,9 @@ Zope Changes ...@@ -121,6 +121,9 @@ Zope Changes
is now installed into the 'bin' folder. is now installed into the 'bin' folder.
Bugs fixed Bugs fixed
- unrestrictedTraverse() refactored to remove hasattr calls (which mask
conflict errors) and for greater readability and maintainability.
- Zope can now be embedded in C/C++ without exceptions being raised - Zope can now be embedded in C/C++ without exceptions being raised
in zdoptions. in zdoptions.
......
...@@ -127,7 +127,6 @@ class Traversable: ...@@ -127,7 +127,6 @@ class Traversable:
return self return self
_getattr = getattr _getattr = getattr
_hasattr = hasattr
_none = None _none = None
marker = _marker marker = _marker
......
...@@ -255,6 +255,12 @@ class TestTraverse( unittest.TestCase ): ...@@ -255,6 +255,12 @@ class TestTraverse( unittest.TestCase ):
SecurityManager.setSecurityPolicy( self.oldPolicy ) SecurityManager.setSecurityPolicy( self.oldPolicy )
self.assertEqual( self.assertEqual(
self.root.restrictedTraverse('happy/happy', 'joy'), 'joy') self.root.restrictedTraverse('happy/happy', 'joy'), 'joy')
def testTraverseUp(self):
# Test that we can traverse upwards
self.failUnless(
aq_base(self.root.folder1.file.restrictedTraverse('../..')) is
aq_base(self.root))
def test_suite(): def test_suite():
......
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