[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/HTTP/tests - testPublisherServer.py:1.3

Stephan Richter srichter@cbu.edu
Fri, 14 Jun 2002 12:50:23 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Server/HTTP/tests
In directory cvs.zope.org:/tmp/cvs-serv18258/lib/python/Zope/Server/HTTP/tests

Modified Files:
	testPublisherServer.py 
Log Message:
Finished Zope 3 Unicode support. Zope 3 should now be able to handle all 
unicode formats. Note that ebcoding and decoding unicode strings is based
on the parameters we get from the browser in HTTP_ACCEPT_CHARSET.

All "text strings" (strings that represent human language text) internally 
in Zope 3 should be unicode strings from now on! I have not checked all of 
Zope 3, so if you see a non-unicode text string somewhere, please convert
it simply by putting 'u' before the string literal.

Note that binary data, such as images are not to be encoded. 

The encoding happens on the HTTPRequest/HTTPResponse abstraction level. 
That means that currenty FTP does not profit from this new code; however
FTP is always data anyhow.


=== Zope3/lib/python/Zope/Server/HTTP/tests/testPublisherServer.py 1.2 => 1.3 ===
 from asyncore import socket_map, poll
 import sys
-
 from threading import Thread
+
 from Zope.Server.TaskThreads import ThreadedTaskDispatcher
 from Zope.Server.HTTP.PublisherHTTPServer import PublisherHTTPServer
-from Zope.Publisher.Browser.BrowserRequest import BrowserRequest
 
+from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
+from Zope.ComponentArchitecture.GlobalAdapterService import provideAdapter
+
+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
 from Zope.Publisher.DefaultPublication import DefaultPublication
 from Zope.Publisher.Exceptions import Redirect, Retry
 from Zope.Publisher.HTTP import HTTPRequest
@@ -82,10 +89,11 @@
 
 
 
-class Tests(unittest.TestCase):
+class Tests(PlacelessSetup, unittest.TestCase):
 
     def setUp(self):
-
+        PlacelessSetup.setUp(self)
+        provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
         obj = tested_object()
         obj.folder = tested_object()
         obj.folder.item = tested_object()