From aab2182cea4f4fd3c64b512b443d6f0f3f35a5a9 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Sun, 4 Sep 2016 23:27:40 -0700 Subject: [PATCH] fix unit test to work on python 2.7 --- tests/test_payload.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_payload.py b/tests/test_payload.py index 5c34c9fc..642feb60 100644 --- a/tests/test_payload.py +++ b/tests/test_payload.py @@ -53,15 +53,15 @@ def test_decode_invalid_payload(self): def test_decode_double_encoded_utf8_payload(self): p = payload.Payload(encoded_payload=b'3:4\xc3\x83\xc2\xa9') self.assertEqual(len(p.packets), 1) - self.assertEqual(p.packets[0].data, 'é') + self.assertEqual(p.packets[0].data.encode('utf-8'), b'\xc3\xa9') def test_decode_double_encoded_utf8_multi_payload(self): p = payload.Payload(encoded_payload=b'3:4\xc3\x83\xc2\xa94:4abc') self.assertEqual(len(p.packets), 2) - self.assertEqual(p.packets[0].data, 'é') + self.assertEqual(p.packets[0].data.encode('utf-8'), b'\xc3\xa9') self.assertEqual(p.packets[1].data, 'abc') def test_decode_single_encoded_utf8_payload(self): p = payload.Payload(encoded_payload=b'3:4\xc3\xa9') self.assertEqual(len(p.packets), 1) - self.assertEqual(p.packets[0].data, 'é') + self.assertEqual(p.packets[0].data.encode('utf-8'), b'\xc3\xa9')