[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container/tests - test_contents.py:1.4
Sidnei da Silva
sidnei@x3ng.com.br
Tue, 11 Feb 2003 11:00:32 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/container/tests
In directory cvs.zope.org:/tmp/cvs-serv3664/src/zope/app/browser/container/tests
Modified Files:
test_contents.py
Log Message:
Merging paris-copypasterename-branch. Not very fun :(
=== Zope3/src/zope/app/browser/container/tests/test_contents.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/container/tests/test_contents.py:1.3 Fri Dec 27 10:22:51 2002
+++ Zope3/src/zope/app/browser/container/tests/test_contents.py Tue Feb 11 10:59:30 2003
@@ -21,9 +21,12 @@
from zope.app.tests.placelesssetup import PlacelessSetup
from zope.component.adapter import provideAdapter
+from zope.app.interfaces.traversing import ITraversable
from zope.app.interfaces.container import IZopeContainer
from zope.app.interfaces.container import IContainer
+from zope.app.interfaces.copy import IObjectMover
from zope.app.container.zopecontainer import ZopeContainerAdapter
+from zope.app.copy import ObjectMover
from zope.app.event.tests.placelesssetup import getEvents
from zope.app.interfaces.event import IObjectRemovedEvent, IObjectModifiedEvent
@@ -44,7 +47,8 @@
def setUp(self):
PlacelessSetup.setUp(self)
provideAdapter(IContainer, IZopeContainer, ZopeContainerAdapter)
-
+ provideAdapter(ITraversable, IZopeContainer, ZopeContainerAdapter)
+ provideAdapter(None, IObjectMover, ObjectMover)
def testInfo(self):
# Do we get the correct information back from ContainerContents?
@@ -143,6 +147,17 @@
urls = map( lambda x: x['url'], info_list )
self.assert_( 'subcontainer' in urls )
+ def testRename( self ):
+ container = self._TestView__newContext()
+ fc = self._TestView__newView( container )
+ ids=['document1', 'document2']
+ for id in ids:
+ document = Document()
+ container.setObject(id, document)
+ fc.renameObjects(ids, ['document1_1',
+ 'document2_2'] )
+ self.failUnless('document1_1' not in container)
+ self.failIf('document_1 in container')
class IDocument(Interface):
pass
@@ -155,7 +170,11 @@
def _TestView__newContext(self):
from zope.app.container.sample import SampleContainer
- return SampleContainer()
+ from zope.app.content.folder import RootFolder
+ from zope.proxy.context import ContextWrapper
+ root = RootFolder()
+ container = SampleContainer()
+ return ContextWrapper(container, root, name='sample')
def _TestView__newView(self, container):
from zope.app.browser.container.contents import Contents