From 08497951fa9aed8d28be8b2dea1aef2135f56769 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Thu, 6 Aug 2015 13:25:30 +0200 Subject: Made LeapMail compatible with SearchEngine. --- service/test/unit/adapter/mailstore/test_leap_mailstore.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'service/test/unit') diff --git a/service/test/unit/adapter/mailstore/test_leap_mailstore.py b/service/test/unit/adapter/mailstore/test_leap_mailstore.py index ed5fce84..4565cc6d 100644 --- a/service/test/unit/adapter/mailstore/test_leap_mailstore.py +++ b/service/test/unit/adapter/mailstore/test_leap_mailstore.py @@ -64,6 +64,15 @@ class TestLeapMail(TestCase): self.assertEqual(body, mail.as_dict()['body']) + def test_raw_constructed_by_headers_and_body(self): + body = 'some body content' + mail = LeapMail('doc id', 'INBOX', {'From': 'test@example.test', 'Subject': 'A test Mail', 'To': 'receiver@example.test'}, ('foo', 'bar'), body=body) + + result = mail.raw + + expected_raw = 'To: receiver@example.test\nFrom: test@example.test\nSubject: A test Mail\n\nsome body content' + self.assertEqual(expected_raw, result) + class TestLeapMailStore(TestCase): def setUp(self): -- cgit v1.2.3