From: Ben Darnell Date: Wed, 18 Feb 2015 22:17:26 +0000 (-0500) Subject: Fix web_test for python 3.5a1. X-Git-Tag: v4.2.0b1~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eb8520d1ce27762cbba41574641d175b430d6c5;p=thirdparty%2Ftornado.git Fix web_test for python 3.5a1. Compare strings case-insensitively since the behavior of the cookie library has changed. --- diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index a643435c6..3fdd7c39c 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -260,10 +260,12 @@ class CookieTest(WebTestCase): def test_set_cookie_false_flags(self): response = self.fetch("/set_falsy_flags") headers = sorted(response.headers.get_list("Set-Cookie")) - self.assertEqual(headers[0], 'a=1; Path=/; secure') - self.assertEqual(headers[1], 'b=1; Path=/') - self.assertEqual(headers[2], 'c=1; httponly; Path=/') - self.assertEqual(headers[3], 'd=1; Path=/') + # The secure and httponly headers are capitalized in py35 and + # lowercase in older versions. + self.assertEqual(headers[0].lower(), 'a=1; path=/; secure') + self.assertEqual(headers[1].lower(), 'b=1; path=/') + self.assertEqual(headers[2].lower(), 'c=1; httponly; path=/') + self.assertEqual(headers[3].lower(), 'd=1; path=/') class AuthRedirectRequestHandler(RequestHandler):