From 6f2ac240210fdd082f1a94e95fa0fdb7577548a7 Mon Sep 17 00:00:00 2001 From: David Wolever Date: Thu, 16 May 2013 23:59:30 -0400 Subject: [PATCH] Fix bytes/str issues --- tornado/test/web_test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 -- 2.47.2