def redirect(self, url, permanent=False, status=None, message=None, message_colour="green", redirect=None): if message is not None or redirect is not None: url += "?" if message is not None: msg = escape.url_escape(message) col = escape.url_escape(message_colour) url += "msg=%s&col=%s" % (msg, col) if redirect is not None: url += "&" if redirect is not None: url += "redirect=%s" % escape.url_escape(redirect) super(RequestHandler, self).redirect(url, permanent, status)
def test_url_escape(self): self.assertEqual(url_escape("a value"), "a+value")