From: Ben Darnell Date: Mon, 20 Feb 2012 04:08:26 +0000 (-0800) Subject: Test for https://github.com/facebook/tornado/pull/454 X-Git-Tag: v2.3.0~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceabffe26ce22d598d75a8170f48d6598e3a2036;p=thirdparty%2Ftornado.git Test for https://github.com/facebook/tornado/pull/454 --- diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index c292b419a..f65b1f68b 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -670,3 +670,19 @@ class CustomStaticFileTest(AsyncHTTPTestCase, LogTrapTestCase): def test_static_url(self): response = self.fetch("/static_url/foo.txt") self.assertEqual(response.body, b("/static/foo.42.txt")) + +class NamedURLSpecGroupsTest(AsyncHTTPTestCase, LogTrapTestCase): + def get_app(self): + class EchoHandler(RequestHandler): + def get(self, path): + self.write(path) + + return Application([("/str/(?P.*)", EchoHandler), + (u"/unicode/(?P.*)", EchoHandler)]) + + def test_named_urlspec_groups(self): + response = self.fetch("/str/foo") + self.assertEqual(response.body, b("foo")) + + response = self.fetch("/unicode/bar") + self.assertEqual(response.body, b("bar")) diff --git a/website/sphinx/releases/next.rst b/website/sphinx/releases/next.rst index a6c7faf41..1a47759f2 100644 --- a/website/sphinx/releases/next.rst +++ b/website/sphinx/releases/next.rst @@ -13,3 +13,5 @@ In progress overwrite the previous cookie instead of producing additional copies. * `tornado.simple_httpclient` correctly verifies SSL certificates for URLs containing IPv6 literals (This bug affected Python 2.5 and 2.6). +* Fixed a bug on python versions before 2.6.5 when `URLSpec` regexes + are constructed from unicode strings and keyword arguments are extracted.