From d186b0204f738367d530514707d0f95a6d4bf865 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Thu, 24 Sep 2015 17:58:16 -0300 Subject: Changed date format to conform to mail RFC #438 --- service/test/support/integration/model.py | 4 +++- service/test/unit/adapter/test_mail.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'service/test') diff --git a/service/test/support/integration/model.py b/service/test/support/integration/model.py index 8b6f9759..c6f6a754 100644 --- a/service/test/support/integration/model.py +++ b/service/test/support/integration/model.py @@ -15,6 +15,7 @@ # along with Pixelated. If not, see . import json +from pixelated.support import date from pixelated.adapter.model.mail import InputMail from pixelated.adapter.model.status import Status @@ -26,7 +27,8 @@ class MailBuilder: 'to': ['recipient@to.com'], 'cc': ['recipient@cc.com'], 'bcc': ['recipient@bcc.com'], - 'subject': 'Hi! This the subject' + 'subject': 'Hi! This the subject', + 'date': date.mail_date_now() }, 'body': "Hello,\nThis is the body of this message\n\nRegards,\n\n--\nPixelated.\n", 'status': [] diff --git a/service/test/unit/adapter/test_mail.py b/service/test/unit/adapter/test_mail.py index bd6ed25b..dc344992 100644 --- a/service/test/unit/adapter/test_mail.py +++ b/service/test/unit/adapter/test_mail.py @@ -62,7 +62,7 @@ def multipart_mail_dict(): class InputMailTest(unittest.TestCase): def test_to_mime_multipart_should_add_blank_fields(self): - pixelated.support.date.iso_now = lambda: 'date now' + pixelated.support.date.mail_date_now = lambda: 'date now' mail_dict = simple_mail_dict() mail_dict['header']['to'] = '' @@ -93,7 +93,7 @@ class InputMailTest(unittest.TestCase): self.assertRegexpMatches(result, 'To: to@pixelated.org') def test_to_mime_multipart(self): - pixelated.support.date.iso_now = lambda: 'date now' + pixelated.support.date.mail_date_now = lambda: 'date now' mime_multipart = InputMail.from_dict(simple_mail_dict()).to_mime_multipart() @@ -107,7 +107,7 @@ class InputMailTest(unittest.TestCase): def test_to_mime_multipart_with_special_chars(self): mail_dict = simple_mail_dict() mail_dict['header']['to'] = u'"Älbert Übrö \xF0\x9F\x92\xA9" <äüö@example.mail>' - pixelated.support.date.iso_now = lambda: 'date now' + pixelated.support.date.mail_date_now = lambda: 'date now' mime_multipart = InputMail.from_dict(mail_dict).to_mime_multipart() -- cgit v1.2.3