Exemple #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)
Exemple #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)
Exemple #3
0
 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)
Exemple #4
0
 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)
Exemple #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)