From 0a21d72a79e02ef3843f0ec3ad7e64383f545b9f Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 27 Nov 2012 20:38:47 -0800 Subject: [PATCH] tolerate non-UTF8 locale in test --- test/test_ui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_ui.py b/test/test_ui.py index eea86adf8..15d52175a 100644 --- a/test/test_ui.py +++ b/test/test_ui.py @@ -704,8 +704,9 @@ class ShowChangeTest(unittest.TestCase): def test_item_data_change_title_missing_with_unicode_filename(self): self.items[0].title = '' self.items[0].path = u'/path/to/caf\xe9.mp3'.encode('utf8') - msg = self._show_change() - self.assertTrue(u'caf\xe9.mp3 -> the title' in msg.decode('utf8')) + msg = self._show_change().decode('utf8') + self.assertTrue(u'caf\xe9.mp3 -> the title' in msg + or u'caf.mp3 ->' in msg) class DefaultPathTest(unittest.TestCase): def setUp(self):