Commit 02c910a7 authored by Tres Seaver's avatar Tres Seaver

Repair breakage; restore commented-out ftest.

parent 3cbd69a8
...@@ -424,9 +424,9 @@ def test_traversable(): ...@@ -424,9 +424,9 @@ def test_traversable():
the wrong reason: None doesn't have a docstring so BaseRequest the wrong reason: None doesn't have a docstring so BaseRequest
raises NotFoundError.) raises NotFoundError.)
>>> from Products.Five.tests.testing.simplecontent \ >>> from Products.Five.tests.testing import simplecontent
... import manage_addSimpleContent >>> simplecontent.manage_addSimpleContent(self.folder, 'testoid',
>>> manage_addSimpleContent(self.folder, 'testoid', 'Testoid') ... 'Testoid')
>>> from zExceptions import NotFound >>> from zExceptions import NotFound
>>> try: >>> try:
... self.folder.testoid.unrestrictedTraverse('doesntexist') ... self.folder.testoid.unrestrictedTraverse('doesntexist')
...@@ -471,9 +471,8 @@ def test_traversable(): ...@@ -471,9 +471,8 @@ def test_traversable():
... </configure>''' ... </configure>'''
>>> zcml.load_string(configure_zcml) >>> zcml.load_string(configure_zcml)
>>> from Products.Five.tests.testing.fancycontent \ >>> from Products.Five.tests.testing import fancycontent
... import manage_addFancyContent >>> info = fancycontent.manage_addFancyContent(self.folder, 'fancy', '')
>>> info = manage_addFancyContent(self.folder, 'fancy', '')
In the following test we let the original __bobo_traverse__ method In the following test we let the original __bobo_traverse__ method
kick in: kick in:
...@@ -510,10 +509,9 @@ def test_traversable(): ...@@ -510,10 +509,9 @@ def test_traversable():
the __bobo_traverse__ is the only element used for traversal lookup). the __bobo_traverse__ is the only element used for traversal lookup).
Let's demonstrate: Let's demonstrate:
>>> from Products.Five.tests.testing.fancycontent \ >>> from Products.Five.tests.testing import fancycontent
... import manage_addNonTraversableFancyContent >>> info = fancycontent.manage_addNonTraversableFancyContent(
>>> info = manage_addNonTraversableFancyContent(self.folder, ... self.folder, 'fancy_zope2', '')
... 'fancy_zope2', '')
>>> self.folder.fancy_zope2.an_attribute = 'This is an attribute' >>> self.folder.fancy_zope2.an_attribute = 'This is an attribute'
>>> self.folder.fancy_zope2.unrestrictedTraverse( >>> self.folder.fancy_zope2.unrestrictedTraverse(
... 'an_attribute').index_html({}) ... 'an_attribute').index_html({})
...@@ -536,8 +534,7 @@ def test_traversable(): ...@@ -536,8 +534,7 @@ def test_traversable():
Verify that after cleanup, there's no cruft left from five:traversable:: Verify that after cleanup, there's no cruft left from five:traversable::
>>> from Products.Five.browser.tests.test_traversable \ >>> from Products.Five.browser.tests.test_traversable import SimpleClass
... import SimpleClass
>>> hasattr(SimpleClass, '__bobo_traverse__') >>> hasattr(SimpleClass, '__bobo_traverse__')
False False
>>> hasattr(SimpleClass, '__fallback_traverse__') >>> hasattr(SimpleClass, '__fallback_traverse__')
...@@ -588,15 +585,14 @@ def test_view_doesnt_shadow_attribute(): ...@@ -588,15 +585,14 @@ def test_view_doesnt_shadow_attribute():
Then we create a traversable folder... Then we create a traversable folder...
>>> from Products.Five.tests.testing.folder \ >>> from Products.Five.tests.testing import folder as ftf
... import manage_addFiveTraversableFolder >>> ftf.manage_addFiveTraversableFolder(self.folder, 'ftf')
>>> manage_addFiveTraversableFolder(self.folder, 'ftf')
and add an object called ``eagle`` to it: and add an object called ``eagle`` to it:
>>> from Products.Five.tests.testing.simplecontent \ >>> from Products.Five.tests.testing import simplecontent
... import manage_addIndexSimpleContent >>> simplecontent.manage_addIndexSimpleContent(self.folder.ftf,
>>> manage_addIndexSimpleContent(self.folder.ftf, 'eagle', 'Eagle') ... 'eagle', 'Eagle')
When we publish the ``ftf/eagle`` now, we expect the attribute to When we publish the ``ftf/eagle`` now, we expect the attribute to
take precedence over the view during traversal: take precedence over the view during traversal:
...@@ -620,7 +616,8 @@ def test_view_doesnt_shadow_attribute(): ...@@ -620,7 +616,8 @@ def test_view_doesnt_shadow_attribute():
However, acquired attributes *should* be shadowed. See discussion on However, acquired attributes *should* be shadowed. See discussion on
http://codespeak.net/pipermail/z3-five/2006q2/001474.html http://codespeak.net/pipermail/z3-five/2006q2/001474.html
>>> manage_addIndexSimpleContent(self.folder, 'mouse', 'Mouse') >>> simplecontent.manage_addIndexSimpleContent(self.folder,
... 'mouse', 'Mouse')
>>> self.folder.ftf.unrestrictedTraverse('mouse')() >>> self.folder.ftf.unrestrictedTraverse('mouse')()
u'The mouse has been eaten by the eagle' u'The mouse has been eaten by the eagle'
...@@ -648,7 +645,7 @@ def test_suite(): ...@@ -648,7 +645,7 @@ def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite( TestTraverse ) ) suite.addTest( unittest.makeSuite( TestTraverse ) )
from Testing.ZopeTestCase import FunctionalDocTestSuite from Testing.ZopeTestCase import FunctionalDocTestSuite
#suite.addTest( FunctionalDocTestSuite() ) suite.addTest( FunctionalDocTestSuite() )
return suite return suite
if __name__ == '__main__': if __name__ == '__main__':
......
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