コード例 #1
0
 def test_delete_cookie(self):
     response = Response()
     response.delete_cookie('test_cookie')
     self.assertEqual(response.cookies['test_cookie']['path'], '/')
     self.assertEqual(response.cookies['test_cookie']['domain'], '')
     self.assertEqual(response.cookies['test_cookie']['expires'],
                      'Thu, 01-Jan-1970 00:00:00 GMT')
コード例 #2
0
    def test_header_items(self):
        response = Response()
        response.delete_cookie('test_cookie')
        response.headers['Location'] = '/'

        self.assertEqual(response.headers_items().sort(), [
            ('Content-Type', 'text/html; charset=utf8'),
            ('Location', '/'),
            ('Set-Cookie', ' test_cookie=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/')
        ].sort())