From a94c1ce58b8bf9e0a8fdd1f1046e97167e84b056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Tue, 23 Feb 2016 15:10:06 +0100 Subject: [PATCH] Fix a problem with mandrill email backend (the good solution) --- taiga/projects/notifications/services.py | 2 +- tests/integration/test_notifications.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/taiga/projects/notifications/services.py b/taiga/projects/notifications/services.py index 801215a5..9730f0c8 100644 --- a/taiga/projects/notifications/services.py +++ b/taiga/projects/notifications/services.py @@ -466,4 +466,4 @@ def make_ms_thread_index(msg_id, dt): thread_bin += md5.digest() # base64 encode - return str(base64.b64encode(thread_bin)) + return base64.b64encode(thread_bin).decode("utf-8") diff --git a/tests/integration/test_notifications.py b/tests/integration/test_notifications.py index 3a8905a3..85ea89fb 100644 --- a/tests/integration/test_notifications.py +++ b/tests/integration/test_notifications.py @@ -422,8 +422,6 @@ def test_send_notifications_using_services_method_for_user_stories(settings, mai assert list_id == headers.get('List-ID') assert 'Thread-Index' in headers - # always is b64 encoded 22 bytes - assert len(base64.b64decode(headers.get('Thread-Index'))) == 22 # hashes should match for identical ids and times # we check the actual method in test_ms_thread_id() @@ -516,8 +514,6 @@ def test_send_notifications_using_services_method_for_tasks(settings, mail): assert list_id == headers.get('List-ID') assert 'Thread-Index' in headers - # always is b64 encoded 22 bytes - assert len(base64.b64decode(headers.get('Thread-Index'))) == 22 # hashes should match for identical ids and times # we check the actual method in test_ms_thread_id() @@ -610,8 +606,6 @@ def test_send_notifications_using_services_method_for_issues(settings, mail): assert list_id == headers.get('List-ID') assert 'Thread-Index' in headers - # always is b64 encoded 22 bytes - assert len(base64.b64decode(headers.get('Thread-Index'))) == 22 # hashes should match for identical ids and times # we check the actual method in test_ms_thread_id() @@ -703,8 +697,6 @@ def test_send_notifications_using_services_method_for_wiki_pages(settings, mail) assert list_id == headers.get('List-ID') assert 'Thread-Index' in headers - # always is b64 encoded 22 bytes - assert len(base64.b64decode(headers.get('Thread-Index'))) == 22 # hashes should match for identical ids and times # we check the actual method in test_ms_thread_id()