[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser/tests - testi18nfileresource.py:1.8

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 2 12:50:10 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/publisher/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv28374/src/zope/app/publisher/browser/tests

Modified Files:
	testi18nfileresource.py 
Log Message:


Completed making the language negotiator a utility.



For tests, register a new utility, not a service.


=== Zope3/src/zope/app/publisher/browser/tests/testi18nfileresource.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/publisher/browser/tests/testi18nfileresource.py:1.7	Thu Nov 27 08:59:23 2003
+++ Zope3/src/zope/app/publisher/browser/tests/testi18nfileresource.py	Tue Mar  2 12:49:39 2004
@@ -11,14 +11,11 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""I18n File-Resource Tests
 
-Revision information:
 $Id$
 """
-
 from unittest import main, makeSuite
-
 import os
 
 from zope.exceptions import NotFoundError
@@ -26,21 +23,17 @@
 from zope.app.tests.placelesssetup import PlacelessSetup
 from zope.app.tests import ztapi
 
-from zope.i18n.interfaces import IUserPreferredCharsets
-from zope.i18n.interfaces import IUserPreferredLanguages
+from zope.i18n.interfaces import IUserPreferredCharsets, IUserPreferredLanguages
 
-from zope.publisher.http import IHTTPRequest
-from zope.publisher.http import HTTPCharsets
-from zope.publisher.browser import BrowserLanguages
-from zope.publisher.browser import TestRequest
+from zope.publisher.http import IHTTPRequest, HTTPCharsets
+from zope.publisher.browser import BrowserLanguages, TestRequest
 
 from zope.app.publisher.browser.i18nfileresource import I18nFileResource
 from zope.app.publisher.browser.i18nfileresource import I18nFileResourceFactory
 from zope.app.publisher.fileresource import File
 import zope.app.publisher.browser.tests as p
 
-from zope.app.component.metaconfigure import \
-     provideService, managerHandler
+from zope.app.component.metaconfigure import managerHandler
 from zope.i18n.interfaces import INegotiator
 from zope.i18n.negotiator import negotiator
 
@@ -58,9 +51,8 @@
                              HTTPCharsets)
         ztapi.provideAdapter(IHTTPRequest, IUserPreferredLanguages,
                              BrowserLanguages)
-        # Setup the negotiator service registry entry
-        managerHandler('defineService', 'LanguageNegotiation', INegotiator)
-        provideService('LanguageNegotiation', negotiator, 'zope.Public')
+        # Setup the negotiator utility
+        ztapi.provideUtility(INegotiator, negotiator)
 
 
     def _createObject(self):




More information about the Zope3-Checkins mailing list