diff options
author | Patrick Maia <patrickjourdanmaia@gmail.com> | 2014-11-11 17:03:02 +0000 |
---|---|---|
committer | Patrick Maia <patrickjourdanmaia@gmail.com> | 2014-11-11 17:03:20 +0000 |
commit | 75efc35c03c1c94103ce6ef4fd0dbe859e54cc63 (patch) | |
tree | 7c461fb707d1728fdb211da66d93cc406d006bd0 /fake-service | |
parent | 6fde0d61a8b0c549efb14a83ad9e39efec4a2887 (diff) |
makes all fake mails seem to have two attachments
Diffstat (limited to 'fake-service')
-rw-r--r-- | fake-service/app/adapter/mail.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fake-service/app/adapter/mail.py b/fake-service/app/adapter/mail.py index 2e2d8e85..40857aba 100644 --- a/fake-service/app/adapter/mail.py +++ b/fake-service/app/adapter/mail.py @@ -18,6 +18,7 @@ import random import calendar from dateutil import parser + class Mail: NOW = calendar.timegm( @@ -39,6 +40,14 @@ class Mail: return mail def __init__(self, mbox_mail=None, ident=None): + attachments = [{'headers': {'Content-Type': 'application/pdf', + 'Content-Transfer-Encoding': 'base64'}, + 'ident': 'BEBACAFE04090', + 'name': 'mydoc.pdf'}, + {'headers': {'Content-Type': 'application/pdf', + 'Content-Transfer-Encoding': 'base64'}, + 'ident': 'BEBACAFE04091', + 'name': 'Party Pictures.jpg'}] if mbox_mail: self.header = self._get_headers(mbox_mail) self.ident = ident @@ -47,10 +56,7 @@ class Mail: self.security_casing = {} self.status = self._get_status() self.draft_reply_for = -1 - self.attachments = [{'headers': {'Content-Type': 'application/pdf', - 'Content-Transfer-Encoding': 'base64'}, - 'ident': 'BEBACAFE04090', - 'name': 'mydoc.pdf'}] + self.attachments = attachments def _get_body(self, message): if message.is_multipart(): @@ -88,7 +94,7 @@ class Mail: mbox_date = mbox_mail.get('Date') if not mbox_date: # means we are still using the mailsets - important for functional tests - return random_date + return random_date return parser.parse(mbox_mail['Date']).isoformat() def _get_tags(self, mbox_mail): |