[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/site/browser/ Backport verification that "tools" generated utilities, which fixes

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Jul 7 17:44:16 EDT 2004


Log message for revision 26192:
Backport verification that "tools" generated utilities, which fixes 
issue 211.



-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/site/browser/ftests/test_utilitytools.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/site/browser/ftests/test_utilitytools.py	2004-07-07 21:37:53 UTC (rev 26191)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/site/browser/ftests/test_utilitytools.py	2004-07-07 21:44:16 UTC (rev 26192)
@@ -60,6 +60,12 @@
         tools = zapi.traverse(root, '/++etc++site/tools')
         self.assert_('zope' in tools.keys())
 
+        # Make sure that the new utility has a parent and a name
+        zope = zapi.getUtility(ITranslationDomain, 'zope', context=tools)
+        self.assertEqual(zapi.getParent(zope), tools)
+        self.assertEqual(zapi.getName(zope), 'zope')
+        
+
     def testDelete(self):
         path = '/++etc++site/@@AddITranslationDomainTool'
         # create the view

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/site/browser/tools.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/site/browser/tools.py	2004-07-07 21:37:53 UTC (rev 26191)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/site/browser/tools.py	2004-07-07 21:44:16 UTC (rev 26192)
@@ -361,7 +361,7 @@
         registration = UtilityRegistration(self.contentName,
                                            self._addFilterInterface,
                                            zapi.getPath(util))
-        reg_view = AddRegistration(content, self.request)
+        reg_view = AddRegistration(util, self.request)
         reg_view.add(registration)
         
         return util



More information about the Zope3-Checkins mailing list