Skip to content

Commit

Permalink
raiseHttpErrors should prevent errors even after redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Sutherland committed Mar 22, 2013
1 parent 0cf6e21 commit 95ac9ef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/zope/testbrowser/tests/test_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ def make_wsgi_app(self):

class TestBrowser(unittest.TestCase):

def test_redirect_and_raiseHttpErrors(self):
app = WSGITestApplication()
browser = zope.testbrowser.wsgi.Browser(wsgi_app=app)
browser.raiseHttpErrors = False
browser.open('http://localhost/redirect.html?to=/not_found.html')
self.assertEqual(browser.headers['status'], '404 Not Found')
self.assertEqual(browser.url, 'http://localhost/not_found.html')

def test_redirect(self):
app = WSGITestApplication()
browser = zope.testbrowser.wsgi.Browser(wsgi_app=app)
Expand Down

0 comments on commit 95ac9ef

Please sign in to comment.