def __call__(self, message): """Set a message to be displayed in the browser on next page display.""" logging.info("Setting flash: %s" % message) message = tg_util.quote_cookie(tg_util.to_utf8(message)) response.cookie['tg_flash'] = message response.cookie['tg_flash']['path'] = '/'
def test_quote_cookie(): assert util.quote_cookie ('Hello, W\xf6rld') \ == 'Hello%2C%20W\xf6rld' assert util.quote_cookie ('$1;\tinsert coin!') \ == '%241%3B%09insert%20coin!'