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

Remove unused local assignment

Add test for upward traversal
parent d131f572
...@@ -122,6 +122,9 @@ Zope Changes ...@@ -122,6 +122,9 @@ Zope Changes
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
......
...@@ -256,6 +256,12 @@ class TestTraverse( unittest.TestCase ): ...@@ -256,6 +256,12 @@ class TestTraverse( unittest.TestCase ):
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():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
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