From: David Wolever Date: Fri, 17 May 2013 03:59:30 +0000 (-0400) Subject: Fix bytes/str issues X-Git-Tag: v3.1.0~68^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f2ac240210fdd082f1a94e95fa0fdb7577548a7;p=thirdparty%2Ftornado.git Fix bytes/str issues --- diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index 3afdae5da..7dcdb83d7 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -811,10 +811,11 @@ class StaticFileTest(WebTestCase): def test_absolute_static_url(self): response = self.fetch("/abs_static_url/robots.txt") - self.assertEqual(response.body, - utf8(self.get_url("/") + - "static/robots.txt?v=" + - self.robots_txt_hash)) + self.assertEqual(response.body, ( + utf8(self.get_url("/")) + + b"static/robots.txt?v=" + + self.robots_txt_hash + )) def test_include_host_override(self): self._trigger_include_host_check(False) @@ -864,8 +865,8 @@ class StaticFileTest(WebTestCase): def test_static_etag(self): response = self.fetch('/static/robots.txt') - self.assertEqual(response.headers.get("Etag"), - b'"%s"' %(self.robots_txt_hash, )) + self.assertEqual(utf8(response.headers.get("Etag")), + b'"' + self.robots_txt_hash + b'"') @wsgi_safe