From 63175dbf45cf26118ba9dfa06e7845b3c1192419 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Jun 18 2018 09:54:42 +0000 Subject: add testcase for https://pagure.io/pagure/issue/3289 Merges https://pagure.io/pagure/pull-request/3317 --- diff --git a/tests/test_pagure_lib_notify.py b/tests/test_pagure_lib_notify.py index 1b94d75..c62c97c 100644 --- a/tests/test_pagure_lib_notify.py +++ b/tests/test_pagure_lib_notify.py @@ -390,6 +390,31 @@ RW1haWwgY29udGVudA== del email["From"] del email["To"] self.assertEqual(email.as_string(), exp) + exp = '''Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: base64 +Subject: =?utf-8?b?W25hbWVzcGFjZS9wcm9qZWN0XSBFbWFpbCDigJxTdWJqZWN04oCc?= +In-Reply-To: +X-Auto-Response-Suppress: All +X-pagure: http://localhost.localdomain/ +X-pagure-project: namespace/project +List-ID: namespace/project +List-Archive: http://localhost.localdomain/namespace/project + +RW1haWwgY29udGVudA== +''' + email = pagure.lib.notify.send_email( + 'Email content', + 'Email “Subject“', + 'foo@bar.com,zöé@foo.net', + mail_id=None, + in_reply_to='test-pull-request-2edbf96ebe644f4bb31b94605e', + project_name='namespace/project', + user_from='Zöé', + ) + del email["From"] + del email["To"] + self.assertEqual(email.as_string(), exp) if __name__ == '__main__':