summaryrefslogtreecommitdiff
path: root/service/test/support
diff options
context:
space:
mode:
authorLisa Junger <ljunger@thoughtworks.com>2014-10-10 18:16:34 +0200
committerLisa Junger <ljunger@thoughtworks.com>2014-10-13 14:38:28 +0200
commit456019b85f9efbc50ccf932e8081641facaf8fae (patch)
tree141273ce68969febf176d95ad1fb0408b26a5222 /service/test/support
parentc2b308ce34eadd5ec2c841da03e111ea107972d8 (diff)
#104 Implemented mark single mail as unread
Diffstat (limited to 'service/test/support')
-rw-r--r--service/test/support/integration_helper.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/service/test/support/integration_helper.py b/service/test/support/integration_helper.py
index c9a80624..5975b9e8 100644
--- a/service/test/support/integration_helper.py
+++ b/service/test/support/integration_helper.py
@@ -22,6 +22,7 @@ from mock import Mock
import shutil
from pixelated.adapter.mail_service import MailService
from pixelated.adapter.search import SearchEngine
+from pixelated.adapter.status import Status
from pixelated.adapter.tag_index import TagIndex
from pixelated.adapter.tag_service import TagService
from pixelated.adapter.draft_service import DraftService
@@ -82,7 +83,8 @@ class MailBuilder:
'bcc': ['recipient@bcc.com'],
'subject': 'Hi! This the subject'
},
- 'body': "Hello,\nThis is the body of this message\n\nRegards,\n\n--\nPixelated.\n"
+ 'body': "Hello,\nThis is the body of this message\n\nRegards,\n\n--\nPixelated.\n",
+ 'status': []
}
def with_body(self, body):
@@ -93,6 +95,10 @@ class MailBuilder:
self.mail['header']['subject'] = subject
return self
+ def with_status(self, status):
+ self.mail['status'].append(Status('read'))
+ return self
+
def with_ident(self, ident):
self.mail['ident'] = ident
return self
@@ -166,6 +172,9 @@ class SoledadTestBase:
def mark_as_read(self, mail_ident):
self.app.post('/mail/' + mail_ident + '/read', content_type="application/json")
+ def mark_as_unread(self, mail_ident):
+ self.app.post('/mail/' + mail_ident + '/unread', content_type="application/json")
+
def add_mail_to_inbox(self, input_mail):
mail = self.pixelated_mailboxes.inbox().add(input_mail)
self.search_engine.index_mail(mail)