[Zope3-checkins] CVS: Zope3/src/zope/app/dav/tests -
test_mkcol.py:1.5
Jim Fulton
cvs-admin at zope.org
Fri Nov 21 12:12:34 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/dav/tests
In directory cvs.zope.org:/tmp/cvs-serv31883/src/zope/app/dav/tests
Modified Files:
test_mkcol.py
Log Message:
Changed to use the new ztapi module, which provides handy functions
for setting up adapters and views for tests. This is needed because
there are no-longer global adapter and view services sitting around as
module globals.
=== Zope3/src/zope/app/dav/tests/test_mkcol.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/dav/tests/test_mkcol.py:1.4 Sun Sep 21 13:30:45 2003
+++ Zope3/src/zope/app/dav/tests/test_mkcol.py Fri Nov 21 12:12:02 2003
@@ -18,6 +18,7 @@
__metaclass__ = type
from unittest import TestCase, TestSuite, main, makeSuite
+from zope.app.tests import ztapi
from zope.component import getService
from zope.app.services.servicenames import Adapters
from zope.app.traversing import traverse
@@ -41,15 +42,14 @@
def setUp(self):
PlacefulSetup.setUp(self)
PlacefulSetup.buildFolders(self)
- provideAdapter = getService(None, Adapters).provideAdapter
- provideAdapter(IWriteContainer, IWriteDirectory, noop)
- provideAdapter(IFolder, IDirectoryFactory, Cloner)
+ ztapi.provideAdapter(IWriteContainer, IWriteDirectory, noop)
+ ztapi.provideAdapter(IFolder, IDirectoryFactory, Cloner)
def test_mkcol_not_folderish(self):
root = self.rootFolder
request = _createRequest('')
container = traverse(root, 'folder1')
- file = File('bla', 'text/plain', 'bla')
+ file = File('bla', 'text/plain', 'bla', container)
container['bla'] = file
file = traverse(container, 'bla')
nr = NullResource(file, 'mkcol_test')
More information about the Zope3-Checkins
mailing list