summaryrefslogtreecommitdiff
path: root/service/test
diff options
context:
space:
mode:
authorBruno Wagner <bwagner@riseup.net>2015-09-24 17:58:16 -0300
committerBruno Wagner <bwagner@riseup.net>2015-09-25 16:54:36 -0300
commitd186b0204f738367d530514707d0f95a6d4bf865 (patch)
tree276f5254aed59efdf5ce3cfc70be43ac448f2189 /service/test
parent6eba069fdb566fd006fa48b8b9c5d5b44085f524 (diff)
Changed date format to conform to mail RFC #438
Diffstat (limited to 'service/test')
-rw-r--r--service/test/support/integration/model.py4
-rw-r--r--service/test/unit/adapter/test_mail.py6
2 files changed, 6 insertions, 4 deletions
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 <http://www.gnu.org/licenses/>.
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()