From c536a088e4d130c3ed783e5bc99f0b9af57c8e62 Mon Sep 17 00:00:00 2001 From: Nathan Ostgard Date: Mon, 11 Jan 2016 08:59:46 -0800 Subject: [PATCH] gh-27 Fix unicode title test --- elodie/tests/media/photo_test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/elodie/tests/media/photo_test.py b/elodie/tests/media/photo_test.py index 156a82d..9db42f3 100644 --- a/elodie/tests/media/photo_test.py +++ b/elodie/tests/media/photo_test.py @@ -184,7 +184,6 @@ def test_set_title(): assert metadata['title'] == 'my photo title', metadata['title'] def test_set_title_non_ascii(): - raise SkipTest('gh-27, non-ascii characters') temporary_folder, folder = helper.create_working_folder() origin = '%s/photo.jpg' % folder @@ -193,8 +192,10 @@ def test_set_title_non_ascii(): photo = Photo(origin) origin_metadata = photo.get_metadata() - status = photo.set_title('形声字 / 形聲字') + unicode_title = u'形声字 / 形聲字' + utf8_title = unicode_title.encode('utf-8') + status = photo.set_title(unicode_title) assert status == True, status photo_new = Photo(origin) @@ -202,4 +203,4 @@ def test_set_title_non_ascii(): shutil.rmtree(folder) - assert metadata['title'] == '形声字 / 形聲字', metadata['title'] + assert metadata['title'] == utf8_title, metadata['title']