def _fetch_cookie(self, cookie_def): cookie = None if cookie_is_encoded(request.COOKIES.get(cookie_def.cookie_key, '')): cookie = request.get_cookie( cookie_def.cookie_key, cookie_def.cookie_secret) return cookie
def testIsEncoded(self): cookie = bottle.cookie_encode(self.data, self.key) self.assertTrue(bottle.cookie_is_encoded(cookie)) self.assertFalse(bottle.cookie_is_encoded(tob('some string')))