From 096f1458a6cbba550d97646166e20bd55ea0fcba 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] [Backport] 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 2725f413..1763ed7b 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 42058f07..c78ab048 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()