From 4d8174edc3856d3b8dea6896d7ec394eea21b397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Thu, 12 May 2016 08:31:47 +0200 Subject: [PATCH] check for py2 and decode --- tests/test_sticker.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_sticker.py b/tests/test_sticker.py index 72edbcd1d..f1b55c507 100644 --- a/tests/test_sticker.py +++ b/tests/test_sticker.py @@ -23,7 +23,7 @@ import unittest import os from flaky import flaky -from future.utils import text_to_native_str +from future.utils import PY2 sys.path.append('.') @@ -71,7 +71,10 @@ class StickerTest(BaseTest, unittest.TestCase): self.assertEqual(sticker.width, self.width) self.assertEqual(sticker.height, self.height) self.assertTrue(isinstance(sticker.thumb, telegram.PhotoSize)) - self.assertEqual(sticker.emoji, text_to_native_str(self.emoji)) + if PY2: + self.assertEqual(sticker.emoji, self.emoji.decode('utf-8')) + else: + self.assertEqual(sticker.emoji, self.emoji) self.assertEqual(sticker.file_size, self.file_size) def test_sticker_de_json(self):