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!'
def flash(message): """Set a message to be displayed in the browser on next page display.""" message = tg_util.quote_cookie(tg_util.to_utf8(message)) response.simple_cookie['tg_flash'] = message response.simple_cookie['tg_flash']['path'] = '/'