[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_registration.py:1.2

Jim Fulton jim at zope.com
Sun Sep 21 13:33:21 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv15240/src/zope/app/services/tests

Modified Files:
	test_registration.py 
Log Message:
Changed location of definition of ObjectAddedEvent.

Changed to use __setitem__ rather than setObject

Object events no longer have locations.


=== Zope3/src/zope/app/services/tests/test_registration.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/services/tests/test_registration.py:1.1	Fri Jul 11 01:50:50 2003
+++ Zope3/src/zope/app/services/tests/test_registration.py	Sun Sep 21 13:33:20 2003
@@ -16,10 +16,11 @@
 
 from unittest import makeSuite, main, TestCase
 
+from zope.app import zapi
 from zope.app.services.hub import Registration
 from zope.app.services.tests.placefulsetup import PlacefulSetup
 from zope.app.traversing import traverse, canonicalPath
-from zope.app.event.objectevent import ObjectAddedEvent
+from zope.app.container.contained import ObjectAddedEvent
 from zope.component import getService
 from zope.app.services.servicenames import EventPublication, HubIds
 
@@ -29,7 +30,7 @@
         self.createStandardServices()
         r = Registration()
         default = traverse(self.rootFolder, '++etc++site/default')
-        default.setObject('registrar', r)
+        default['registrar'] = r
         self.registrar = traverse(default, 'registrar')
         self.hub = getService(self.rootFolder, HubIds)
         self.events = getService(self.rootFolder, EventPublication)
@@ -47,10 +48,9 @@
     def testRegister(self):
         self.registrar.subscribe()
         self.assertEqual(self.hub.numRegistrations(), 0)
-        content = object()
-        name = 'blah'
+        content = zapi.traverse(self.rootFolder, "folder1/folder1_1")
 
-        event = ObjectAddedEvent(content, canonicalPath('/%s' % name))
+        event = ObjectAddedEvent(content)
         self.events.publish(event)
         self.assertEqual(self.hub.numRegistrations(), 1)
 




More information about the Zope3-Checkins mailing list