[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser/tests - testBrowserRequest.py:1.5.2.1

Stephan Richter srichter@cbu.edu
Fri, 14 Jun 2002 10:49:03 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv20580/lib/python/Zope/Publisher/Browser/tests

Modified Files:
      Tag: srichter-z3-unicode-branch
	testBrowserRequest.py 
Log Message:
Branch-specifc commit, so that Barry and Fred can help me debug the existing
errors.


=== Zope3/lib/python/Zope/Publisher/Browser/tests/testBrowserRequest.py 1.5 => 1.5.2.1 ===
 import unittest
 
+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.Browser.BrowserResponse import BrowserResponse
 
@@ -36,20 +43,24 @@
 
     
 
-class BrowserTests(HTTPTests):
+class BrowserTests(HTTPTests, PlacelessSetup):
 
     _testEnv =  {
-        'PATH_INFO':          '/folder/item',
-        'QUERY_STRING':       'a=5&b:int=6',
-        'SERVER_URL':         'http://foobar.com',
-        'HTTP_HOST':          'foobar.com',
-        'CONTENT_LENGTH':     '0',
-        'HTTP_AUTHORIZATION': 'Should be in accessible',
-        'GATEWAY_INTERFACE':  'TestFooInterface/1.0',
-        'HTTP_OFF_THE_WALL':  "Spam 'n eggs",
+        'PATH_INFO':           '/folder/item',
+        'QUERY_STRING':        'a=5&b:int=6',
+        'SERVER_URL':          'http://foobar.com',
+        'HTTP_HOST':           'foobar.com',
+        'CONTENT_LENGTH':      '0',
+        'HTTP_AUTHORIZATION':  'Should be in accessible',
+        'GATEWAY_INTERFACE':   'TestFooInterface/1.0',
+        'HTTP_OFF_THE_WALL':   "Spam 'n eggs",
+        'HTTP_ACCEPT_CHARSET': 'ISO-8859-1, UTF-8;q=0.66, UTF-16;q=0.33', 
     }
     
     def setUp(self):
+        PlacelessSetup.setUp(self)
+        provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
+
         class AppRoot:
             " "
 
@@ -103,7 +114,7 @@
             res,
             "Status: 200 Ok\r\n"
             "Content-Length: 7\r\n"
-            "Content-Type: text/plain\r\n"
+            "Content-Type: text/plain;charset=UTF-8\r\n"
             "X-Powered-By: Zope (www.zope.org), Python (www.python.org)\r\n"
             "\r\n"
             "u'5', 6")