示例#1
0
 def _follow(self, **kw):
     location = self.headers['location']
     abslocation = urlparse.urljoin(self.request.url, location)
     type_, rest = splittype(abslocation)
     host, path = splithost(rest)
     # @@: We should test that it's not a remote redirect
     return self.test_app.get(abslocation, **kw)
示例#2
0
 def _follow(self, **kw):
     location = self.headers['location']
     abslocation = urlparse.urljoin(self.request.url, location)
     type_, rest = splittype(abslocation)
     host, path = splithost(rest)
     # @@: We should test that it's not a remote redirect
     return self.test_app.get(abslocation, **kw)
示例#3
0
文件: app.py 项目: humble/webtest
 def follow(self, **kw):
     """
     If this request is a redirect, follow that redirect.  It
     is an error if this is not a redirect response.  Returns
     another response object.
     """
     assert self.status_int >= 300 and self.status_int < 400, (
         "You can only follow redirect responses (not %s)"
         % self.status)
     location = self.headers['location']
     type, rest = splittype(location)
     host, path = splithost(rest)
     # @@: We should test that it's not a remote redirect
     return self.test_app.get(location, **kw)
示例#4
0
文件: response.py 项目: kmike/webtest
 def follow(self, **kw):
     """
     If this response is a redirect, follow that redirect.  It is an
     error if it is not a redirect response. Any keyword
     arguments are passed to :class:`webtest.app.TestApp.get`. Returns
     another :class:`TestResponse` object.
     """
     assert self.status_int >= 300 and self.status_int < 400, (
         "You can only follow redirect responses (not %s)"
         % self.status)
     location = self.headers['location']
     type, rest = splittype(location)
     host, path = splithost(rest)
     # @@: We should test that it's not a remote redirect
     return self.test_app.get(location, **kw)
示例#5
0
 def _follow(self, **kw):
     location = self.headers['location']
     type_, rest = splittype(location)
     host, path = splithost(rest)
     # @@: We should test that it's not a remote redirect
     return self.test_app.get(location, **kw)