[Zope-Checkins] CVS: Zope3/lib/python/Zope/I18n/Views/Browser/tests - testTranslate.py:1.2.2.1
Stephan Richter
srichter@cbu.edu
Fri, 14 Jun 2002 10:49:02 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/I18n/Views/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv20580/lib/python/Zope/I18n/Views/Browser/tests
Modified Files:
Tag: srichter-z3-unicode-branch
testTranslate.py
Log Message:
Branch-specifc commit, so that Barry and Fred can help me debug the existing
errors.
=== Zope3/lib/python/Zope/I18n/Views/Browser/tests/testTranslate.py 1.2 => 1.2.2.1 ===
import unittest
-from cStringIO import StringIO
+from StringIO import StringIO
+
+from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
+from Zope.ComponentArchitecture.GlobalAdapterService import provideAdapter
+from Zope.ComponentArchitecture.GlobalFactoryService import provideFactory
from Zope.I18n.Views.Browser.Translate import Translate
from Zope.I18n.TranslationService import TranslationService
from Zope.I18n.MessageCatalog import MessageCatalog
+from Zope.I18n.IUserPreferredCharsets import IUserPreferredCharsets
+from Zope.Publisher.HTTP.HTTPRequest import IHTTPRequest
+from Zope.Publisher.HTTP.HTTPCharsets import HTTPCharsets
from Zope.Publisher.Browser.BrowserRequest import BrowserRequest
-# Setup the registries
-from Zope.ComponentArchitecture.IFactoryService import IFactoryService
-from Zope.ComponentArchitecture.GlobalFactoryService import \
- factoryService
-from Zope.App.ComponentArchitecture.metaConfigure import \
- provideService, managerHandler
-from Zope.App.ComponentArchitecture.metaConfigure import handler
-
-
-class TranslateTest(unittest.TestCase):
+class TranslateTest(unittest.TestCase, PlacelessSetup):
def setUp(self):
+ PlacelessSetup.setUp(self)
- try:
- # Setup the registries
- managerHandler('defineService', 'Factories', IFactoryService)
- provideService('Factories', factoryService, 'Zope.Public')
-
- handler('Factories', 'provideFactory', 'Message Catalog',
- MessageCatalog)
- except:
- pass
+ # Setup the registries
+ provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
+ provideFactory('Message Catalog', MessageCatalog)
service = TranslationService('default')
@@ -136,3 +129,4 @@
if __name__=='__main__':
unittest.main()
+