[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/tests - testZopePublication.py:1.3
Stephan Richter
srichter@cbu.edu
Fri, 14 Jun 2002 12:50:50 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/tests
In directory cvs.zope.org:/tmp/cvs-serv18258/lib/python/Zope/App/ZopePublication/tests
Modified Files:
testZopePublication.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/App/ZopePublication/tests/testZopePublication.py 1.2 => 1.3 ===
import unittest
+from StringIO import StringIO
+
+from Interface import Interface
+from Interface.Verify import verifyClass
+from Interface.Implements import instancesOfObjectImplements
+
+import ZODB
+from ZODB.MappingStorage import MappingStorage
+
+from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
+from Zope.ComponentArchitecture import getService, getServiceManager
+from Zope.ComponentArchitecture.GlobalAdapterService import provideAdapter
+
+from Zope.I18n.IUserPreferredCharsets import IUserPreferredCharsets
+
from Zope.Publisher.Publish import publish
+from Zope.Publisher.DefaultPublication import TestPublication
+from Zope.Publisher.IPublication import IPublication
+from Zope.Publisher.HTTP.HTTPRequest import IHTTPRequest
+from Zope.Publisher.HTTP.HTTPCharsets import HTTPCharsets
from Zope.Publisher.Browser.BrowserRequest import TestRequest
from Zope.Publisher.Browser.BrowserView import BrowserView
+from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
+from Zope.Publisher.Browser.IBrowserPresentation import IBrowserPresentation
+
+from Zope.App.Security.PrincipalRegistry import principalRegistry
+from Zope.App.Security.PrincipalRoleManager import principalRoleManager
+
from Zope.App.ZopePublication.ZopePublication import ZopePublication
from Zope.App.ZopePublication.Browser.Publication import BrowserPublication
+from Zope.App.ZopePublication.Traversers import TestTraverser
+
from Zope.Configuration.name import resolve
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
-from Zope.Publisher.Browser.IBrowserPresentation import IBrowserPresentation
-from Zope.Publisher.DefaultPublication import TestPublication
-from Zope.Publisher.IPublication import IPublication
from Zope.Proxy.ContextWrapper import getWrapperContext
from Zope.ContextWrapper import Wrapper
from Zope.ContextWrapper import wrapperTypes
-import ZODB
-from ZODB.MappingStorage import MappingStorage
from Zope.Publisher.Exceptions import Retry
-from Zope.App.ZopePublication.Traversers import TestTraverser
from Zope.Security import SimpleSecurityPolicies
from Zope.Security.SecurityManagement import setSecurityPolicy
-from Interface import Interface
-from Interface.Verify import verifyClass
-from Interface.Implements import instancesOfObjectImplements
-
-from Zope.ComponentArchitecture.tests.PlacelessSetup\
- import PlacelessSetup
-from Zope.ComponentArchitecture import getService, getServiceManager
-
-
-from Zope.App.Security.PrincipalRegistry import principalRegistry
-from Zope.App.Security.PrincipalRoleManager import principalRoleManager
from Zope.Proxy.ProxyIntrospection import removeAllProxies
from Zope.Security.Checker import defineChecker, NamesChecker
-from StringIO import StringIO
def foo():
" "
@@ -75,6 +83,7 @@
def setUp(self):
PlacelessSetup.setUp(self)
+ provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
self.policy = setSecurityPolicy(
SimpleSecurityPolicies.PermissiveSecurityPolicy()
)