[Checkins] SVN: grokcore.view/trunk/src/grokcore/view/ftests/url/redirect.py Fix test with newer zope.testbrowser, that does not do non-localhost.

Jan-Jaap Driessen jdriessen at thehealthagency.com
Tue Mar 15 19:04:50 EDT 2011


Log message for revision 120967:
  Fix test with newer zope.testbrowser, that does not do non-localhost.

Changed:
  U   grokcore.view/trunk/src/grokcore/view/ftests/url/redirect.py

-=-
Modified: grokcore.view/trunk/src/grokcore/view/ftests/url/redirect.py
===================================================================
--- grokcore.view/trunk/src/grokcore/view/ftests/url/redirect.py	2011-03-15 23:00:13 UTC (rev 120966)
+++ grokcore.view/trunk/src/grokcore/view/ftests/url/redirect.py	2011-03-15 23:04:50 UTC (rev 120967)
@@ -6,17 +6,20 @@
 Since the index view redirects to mammoth, we expect to see the URL
 point to mammoth:
 
-  >>> from zope.app.wsgi.testlayer import Browser
+  >>> from zope.app.wsgi.testlayer import Browser, http
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open('http://localhost/manfred')
   >>> browser.url
   'http://localhost/manfred/another'
 
-  >>> browser.open('http://localhost/manfred/trustedredirect')
-  >>> browser.url
-  'http://www.google.com/'
+  >>> response = http('GET /manfred/trustedredirect HTTP/1.0')
+  >>> response.getStatus()
+  302
+  >>> response.getHeader('location')
+  'http://www.google.com/ncr'
 
+
   >>> browser.open('http://localhost/manfred/redirectwithstatus')
   Traceback (most recent call last):
   ...



More information about the checkins mailing list