diff options
author | Bruno Wagner <bwagner@thoughtworks.com> | 2014-09-15 16:19:01 -0300 |
---|---|---|
committer | Bruno Wagner <bwagner@thoughtworks.com> | 2014-09-15 16:19:27 -0300 |
commit | 80f973cb363f6fe938828172b4d756e923639187 (patch) | |
tree | 97dee1afcae9eec36496e187ee88225023cbb96b /py-fake-service/app/adapter | |
parent | 3f158be0b30fa16dbc3ee7f60bd593e89bea1fb8 (diff) |
#47 The csv date is now parsed when importing messages, and will be used instead of the random one from before
Diffstat (limited to 'py-fake-service/app/adapter')
-rw-r--r-- | py-fake-service/app/adapter/mail.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/py-fake-service/app/adapter/mail.py b/py-fake-service/app/adapter/mail.py index 5a298385..26c00277 100644 --- a/py-fake-service/app/adapter/mail.py +++ b/py-fake-service/app/adapter/mail.py @@ -16,7 +16,7 @@ from datetime import datetime import random import calendar - +from dateutil import parser class Mail: @@ -74,10 +74,7 @@ class Mail: headers['from'] = mbox_mail.get('From') or mbox_mail.from_addr headers['to'] = [mbox_mail.get('To')] headers['subject'] = mbox_mail.get('Subject') - headers['date'] = datetime.fromtimestamp( - random.randrange( - 1222222222, - self.NOW)).isoformat() + headers['date'] = parser.parse(mbox_mail['Date']).isoformat() headers['content_type'] = mbox_mail.get('Content-Type') return headers |