[Zope-Checkins] SVN: Zope/branches/2.9/configure Fixed acceptable versions, it wouldn't accept 2.4.2 properly.
Log message for revision 66597: Fixed acceptable versions, it wouldn't accept 2.4.2 properly. Changed: U Zope/branches/2.9/configure -=- Modified: Zope/branches/2.9/configure === --- Zope/branches/2.9/configure 2006-04-06 17:12:03 UTC (rev 66596) +++ Zope/branches/2.9/configure 2006-04-06 17:46:52 UTC (rev 66597) @@ -18,7 +18,7 @@ # sys.version) below in best to worst order, not including the # target version. Up to six acceptable python versions are allowed. # Do not include the target version number in this list! -ACCEPTABLE=2.4.1 2.4.2. +ACCEPTABLE=2.4.1 2.4.2 # provide the executable names for all the acceptable versions # (and the target version) below ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/Sessions/tests/testBrowserIdManager.py Tests should not pollute os.environ when a dict will do just fine;
Log message for revision 66605: Tests should not pollute os.environ when a dict will do just fine; this caused failures in testVirtualHostMonster when Testing/makerequest was modified. Changed: U Zope/branches/2.9/lib/python/Products/Sessions/tests/testBrowserIdManager.py -=- Modified: Zope/branches/2.9/lib/python/Products/Sessions/tests/testBrowserIdManager.py === --- Zope/branches/2.9/lib/python/Products/Sessions/tests/testBrowserIdManager.py 2006-04-06 18:56:13 UTC (rev 66604) +++ Zope/branches/2.9/lib/python/Products/Sessions/tests/testBrowserIdManager.py 2006-04-06 19:03:04 UTC (rev 66605) @@ -27,7 +27,6 @@ from ZPublisher.HTTPResponse import HTTPResponse from ZPublisher.BeforeTraverse import queryBeforeTraverse from sys import stdin -from os import environ from OFS.Application import Application class TestBrowserIdManager(TestCase): @@ -38,6 +37,7 @@ self.app._setObject('browser_id_manager', mgr) self.m = self.app.browser_id_manager resp = HTTPResponse() +environ = {} environ['SERVER_NAME']='fred' environ['SERVER_PORT']='80' self.req = HTTPRequest(stdin, environ, resp) @@ -238,6 +238,7 @@ bid = '43295340A0bpcu4nkCI' name = '_ZopeId' resp = HTTPResponse() +environ = {} environ['SERVER_NAME']='fred' environ['SERVER_PORT']='80' self.req = HTTPRequest(stdin, environ, resp) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Sessions/tests/testBrowserIdManager.py Merged environment pollution fix from 2.9 branch.
Log message for revision 66609: Merged environment pollution fix from 2.9 branch. Changed: U Zope/trunk/lib/python/Products/Sessions/tests/testBrowserIdManager.py -=- Modified: Zope/trunk/lib/python/Products/Sessions/tests/testBrowserIdManager.py === --- Zope/trunk/lib/python/Products/Sessions/tests/testBrowserIdManager.py 2006-04-06 19:11:09 UTC (rev 66608) +++ Zope/trunk/lib/python/Products/Sessions/tests/testBrowserIdManager.py 2006-04-06 19:11:54 UTC (rev 66609) @@ -27,7 +27,6 @@ from ZPublisher.HTTPResponse import HTTPResponse from ZPublisher.BeforeTraverse import queryBeforeTraverse from sys import stdin -from os import environ from OFS.Application import Application class TestBrowserIdManager(TestCase): @@ -38,6 +37,7 @@ self.app._setObject('browser_id_manager', mgr) self.m = self.app.browser_id_manager resp = HTTPResponse() +environ = {} environ['SERVER_NAME']='fred' environ['SERVER_PORT']='80' self.req = HTTPRequest(stdin, environ, resp) @@ -238,6 +238,7 @@ bid = '43295340A0bpcu4nkCI' name = '_ZopeId' resp = HTTPResponse() +environ = {} environ['SERVER_NAME']='fred' environ['SERVER_PORT']='80' self.req = HTTPRequest(stdin, environ, resp) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Testing/ Reverting refactoring of ZopeTestCase.utils.makerequest,
Log message for revision 66621: Reverting refactoring of ZopeTestCase.utils.makerequest, and the related addition of an environ argument to Testing.makerequest. This was not a bugfix, thus inappropriate for the stable branch. Apologies. Changed: U Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py U Zope/branches/2.9/lib/python/Testing/makerequest.py U Zope/branches/2.9/lib/python/Testing/tests/test_makerequest.py -=- Modified: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py === --- Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py 2006-04-06 21:23:23 UTC (rev 66620) +++ Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py 2006-04-06 21:30:58 UTC (rev 66621) @@ -127,14 +127,26 @@ def makerequest(app, stdout=sys.stdout): '''Wraps the app into a fresh REQUEST.''' -from Testing.makerequest import makerequest as _makerequest +from ZPublisher.BaseRequest import RequestContainer +from ZPublisher.Request import Request +from ZPublisher.Response import Response +response = Response(stdout=stdout) environ = {} environ['SERVER_NAME'] = _Z2HOST or 'nohost' environ['SERVER_PORT'] = '%d' % (_Z2PORT or 80) environ['REQUEST_METHOD'] = 'GET' -app = _makerequest(app, stdout=stdout, environ=environ) -return app +request = Request(sys.stdin, environ, response) +request._steps = ['noobject'] # Fake a published object +request['ACTUAL_URL'] = request.get('URL') # Zope 2.7.4 +# set Zope3-style default skin so that the request is usable for +# Zope3-style view look-ups +from zope.app.publication.browser import setDefaultSkin +setDefaultSkin(request) + +return app.__of__(RequestContainer(REQUEST=request)) + + def appcall(function, *args, **kw): '''Calls a function passing 'app' as first argument.''' from base import app, close Modified: Zope/branches/2.9/lib/python/Testing/makerequest.py === --- Zope/branches/2.9/lib/python/Testing/makerequest.py 2006-04-06 21:23:23 UTC (rev 66620) +++ Zope/branches/2.9/lib/python/Testing/makerequest.py 2006-04-06 21:30:58 UTC (rev 66621) @@ -38,13 +38,12 @@ from ZPublisher.HTTPResponse import HTTPResponse from ZPublisher.BaseRequest import RequestContainer -def makerequest(app, stdout=stdout, environ=None): +def makerequest(app, stdout=stdout): resp = HTTPResponse(stdout=stdout) -if environ is None: -environ = os.environ -environ.setdefault('SERVER_NAME', 'foo') -environ.setdefault('SERVER_PORT', '80') -environ.setdefault('REQUEST_METHOD', 'GET') +environ = os.environ +environ['SERVER_NAME'] = 'foo' +environ['SERVER_PORT'] = '80' +environ['REQUEST_METHOD'] = 'GET' req = HTTPRequest(stdin, environ, resp) req._steps = ['noobject'] # Fake a published object. req['ACTUAL_URL'] = req.get('URL') # Zope 2.7.4 Modified: Zope/branches/2.9/lib/python/Testing/tests/test_makerequest.py === --- Zope/branches/2.9/lib/python/Testing/tests/test_makerequest.py 2006-04-06 21:23:23 UTC (rev 66620) +++ Zope/branches/2.9/lib/python/Testing/tests/test_makerequest.py 2006-04-06 21:30:58 UTC (rev 66621) @@ -50,11 +50,6 @@ self.failUnless(written.startswith('Status: 200 OK\n')) self.failUnless(written.endswith('\naaa')) -def test_environ(self): -# You can pass an environ argument to use in the request. -environ = {'foofoo': 'barbar'} -item = makerequest(SimpleItem(), environ=environ) -self.assertEqual(item.REQUEST.environ['foofoo'], 'barbar') def test_suite(): suite = unittest.TestSuite() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins