[Zope3-checkins] CVS: Zope3/src/zope/app/i18n/tests - test_filters.py:1.2 test_translationdomain.py:1.2

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 9 07:39:37 EST 2004


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

Modified Files:
	test_filters.py test_translationdomain.py 
Log Message:


Adjusted code to use utility service to look up factories or use the new zapi
methods.




=== Zope3/src/zope/app/i18n/tests/test_filters.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/i18n/tests/test_filters.py:1.1	Mon Mar  8 18:34:51 2004
+++ Zope3/src/zope/app/i18n/tests/test_filters.py	Tue Mar  9 07:39:05 2004
@@ -21,12 +21,10 @@
 from cStringIO import StringIO
 from zope.interface import implements
 
-from zope.app.services.servicenames import Factories
-
 from zope.app.tests import ztapi
 from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.app.component.metaconfigure import \
-     provideService, managerHandler, handler
+from zope.component.interfaces import IFactory
+from zope.component.factory import Factory
 
 from zope.app.i18n.messagecatalog import MessageCatalog
 from zope.i18n.negotiator import negotiator
@@ -75,9 +73,8 @@
 
         self._domain = TranslationDomain()
         self._domain.domain = 'default'
-        handler(Factories, 'provideFactory', 'Message Catalog',
-                MessageCatalog)
-
+        ztapi.provideUtility(IFactory, Factory(MessageCatalog),
+                             'Message Catalog')
 
     def testImportExport(self):
         imp = GettextImportFilter(self._domain)


=== Zope3/src/zope/app/i18n/tests/test_translationdomain.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/i18n/tests/test_translationdomain.py:1.1	Mon Mar  8 18:34:51 2004
+++ Zope3/src/zope/app/i18n/tests/test_translationdomain.py	Tue Mar  9 07:39:05 2004
@@ -18,15 +18,15 @@
 import unittest
 
 from zope.app import zapi
-from zope.app.component.metaconfigure import handler
-from zope.app.component.metaconfigure import managerHandler
+from zope.component.interfaces import IFactory
+from zope.component.factory import Factory
 from zope.app.i18n.interfaces import ISyncTranslationDomain
-from zope.app.services.servicenames import Factories, Utilities
+from zope.app.services.servicenames import Utilities
 from zope.app.i18n.messagecatalog import MessageCatalog
 from zope.i18n.translationdomain \
      import TranslationDomain as GlobalTranslationDomain
 from zope.app.i18n.translationdomain import TranslationDomain
-from zope.app.tests import setup
+from zope.app.tests import setup, ztapi
 from zope.i18n.interfaces import IUserPreferredLanguages, ITranslationDomain
 from zope.i18n.tests.test_itranslationdomain import TestITranslationDomain
 from zope.interface import implements, classImplements
@@ -195,8 +195,8 @@
         setup.addService(self.sm, Utilities, LocalUtilityService())
         setup.addUtility(self.sm, 'default', ITranslationDomain, self._domain)
         
-        handler(Factories, 'provideFactory', 'Message Catalog',
-                MessageCatalog)
+        ztapi.provideUtility(IFactory, Factory(MessageCatalog),
+                             'Message Catalog')
 
 
     def _getTranslationDomain(self):




More information about the Zope3-Checkins mailing list