]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix bytes/str issues
authorDavid Wolever <david@wolever.net>
Fri, 17 May 2013 03:59:30 +0000 (23:59 -0400)
committerDavid Wolever <david@wolever.net>
Fri, 17 May 2013 03:59:30 +0000 (23:59 -0400)
tornado/test/web_test.py

index 3afdae5da9813cdefe081e420a18edad8f790bfd..7dcdb83d7f7055a0693745058310aa4c933a6a8f 100644 (file)
@@ -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