[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/tests - testAbsoluteURL.py:1.2 testObjectName.py:1.2
Stephan Richter
srichter@cbu.edu
Fri, 14 Jun 2002 12:50:50 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/tests
In directory cvs.zope.org:/tmp/cvs-serv18258/lib/python/Zope/App/ZopePublication/TraversalViews/tests
Modified Files:
testAbsoluteURL.py testObjectName.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/TraversalViews/tests/testAbsoluteURL.py 1.1 => 1.2 ===
from unittest import TestCase, TestSuite, main, makeSuite
-from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
+from Interface import Interface
+from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
from Zope.ComponentArchitecture import getService, getView
-from Zope.Publisher.Browser.IBrowserPresentation import IBrowserPresentation
+
+from Zope.I18n.IUserPreferredCharsets import IUserPreferredCharsets
+
from Zope.Publisher.HTTP.tests.TestRequest import TestRequest
+from Zope.Publisher.HTTP.HTTPRequest import IHTTPRequest
+from Zope.Publisher.HTTP.HTTPCharsets import HTTPCharsets
+from Zope.Publisher.Browser.IBrowserPresentation import IBrowserPresentation
from Zope.Proxy.ContextWrapper import ContextWrapper
-from Interface import Interface
+
class IRoot(Interface): pass
@@ -45,6 +51,8 @@
[AbsoluteURL])
provideView(IRoot, 'absolute_url', IBrowserPresentation,
[SiteAbsoluteURL])
+ provideAdapter = getService(None, "Adapters").provideAdapter
+ provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
def testBadObject(self):
request = TestRequest()
=== Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/tests/testObjectName.py 1.1 => 1.2 ===
$Id$
"""
-
from unittest import TestCase, TestSuite, main, makeSuite
-from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
+from Interface import Interface
+from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
from Zope.ComponentArchitecture import getService, getView, getAdapter
+
+from Zope.I18n.IUserPreferredCharsets import IUserPreferredCharsets
+
from Zope.Publisher.Browser.IBrowserPresentation import IBrowserPresentation
from Zope.Publisher.HTTP.tests.TestRequest import TestRequest
+from Zope.Publisher.HTTP.HTTPRequest import IHTTPRequest
+from Zope.Publisher.HTTP.HTTPCharsets import HTTPCharsets
+
from Zope.Proxy.ContextWrapper import ContextWrapper
-from Interface import Interface
from Zope.App.ZopePublication.TraversalViews.ObjectName \
import IObjectName, ObjectName, SiteObjectName
@@ -49,6 +54,7 @@
[SiteObjectName])
provideAdapter = getService(None, "Adapters").provideAdapter
+ provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
provideAdapter(None, IObjectName, [ObjectName])
provideAdapter(IRoot, IObjectName, [ObjectName])