diff options
author | Giovane <giovaneliberato@gmail.com> | 2016-02-22 14:39:10 -0300 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2016-02-22 14:39:10 -0300 |
commit | f40a56b2c754ea9254a54b240d3e6ca8d5bd0b1d (patch) | |
tree | 669e86005bc4cafce725103cc0d7b18c30eedb27 /service/test/integration/test_leap_mailstore.py | |
parent | 7c1affe11f7563911c34c9d439fe5ed1bf7c3a17 (diff) |
Revert "Revert "Filter keys from attachments #608 w/ @deniscostadsc""
This reverts commit f92e802df2aeec9b2341ba5b4efea48356edf01f.
Diffstat (limited to 'service/test/integration/test_leap_mailstore.py')
-rw-r--r-- | service/test/integration/test_leap_mailstore.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/service/test/integration/test_leap_mailstore.py b/service/test/integration/test_leap_mailstore.py index 885aa62b..f52d7c9c 100644 --- a/service/test/integration/test_leap_mailstore.py +++ b/service/test/integration/test_leap_mailstore.py @@ -50,6 +50,19 @@ class LeapMailStoreTest(SoledadTestBase): self.assertEqual(expected_mail_dict['header'], fetched_mail.as_dict()['header']) @defer.inlineCallbacks + def test_remove_key_from_attachments(self): + input_mail = MIMEMultipart() + input_mail.attach(MIMEText(u'a utf8 message', _charset='utf-8')) + attachment = MIMEApplication('pretend to be binary attachment data') + attachment.add_header('Content-Disposition', 'attachment', filename='pub.key') + attachment.replace_header('Content-Type', 'application/pgp-keys') + input_mail.attach(attachment) + + mail = yield self.mail_store.add_mail('INBOX', input_mail.as_string()) + fetched_mail = yield self.mail_store.get_mail(mail.ident, include_body=True) + self.assertEquals(fetched_mail.as_dict().get('attachments'), []) + + @defer.inlineCallbacks def test_round_trip_through_soledad_keeps_attachment(self): input_mail = MIMEMultipart() input_mail.attach(MIMEText(u'a utf8 message', _charset='utf-8')) @@ -59,6 +72,7 @@ class LeapMailStoreTest(SoledadTestBase): mail = yield self.mail_store.add_mail('INBOX', input_mail.as_string()) fetched_mail = yield self.mail_store.get_mail(mail.ident, include_body=True) + self.assertDictEqual(mail.as_dict(), fetched_mail.as_dict()) @defer.inlineCallbacks def test_all_mails(self): |