summaryrefslogtreecommitdiff
path: root/service/test/integration/test_mark_as_read_unread.py
diff options
context:
space:
mode:
authorRoald de Vries <rdevries@thoughtworks.com>2016-12-07 15:26:10 +0100
committerRoald de Vries <rdevries@thoughtworks.com>2016-12-07 15:26:10 +0100
commitd10f607a4d40587510b0dc31b31fe4750bf4a3a3 (patch)
treedb016bb0878989249e0f329e2162d11067b0f8b7 /service/test/integration/test_mark_as_read_unread.py
parentc28abba2f5b1186c671ebef508d40ffaae6d5bc5 (diff)
parenteaf2019b6e977d1191e0ee12f694a02bb9612f83 (diff)
[#801] Merge branch 'signup'
Diffstat (limited to 'service/test/integration/test_mark_as_read_unread.py')
-rw-r--r--service/test/integration/test_mark_as_read_unread.py29
1 files changed, 21 insertions, 8 deletions
diff --git a/service/test/integration/test_mark_as_read_unread.py b/service/test/integration/test_mark_as_read_unread.py
index 18c3ddc2..c01deefc 100644
--- a/service/test/integration/test_mark_as_read_unread.py
+++ b/service/test/integration/test_mark_as_read_unread.py
@@ -30,32 +30,40 @@ class MarkAsReadUnreadTest(SoledadTestBase):
mails = yield self.app_test_client.get_mails_by_tag('inbox')
self.assertNotIn('read', mails[0].status)
- yield self.app_test_client.mark_many_as_read([mail.ident])
+ response, first_request = yield self.app_test_client.get('/', as_json=False)
+ session = first_request.getSession()
+ yield self.app_test_client.mark_many_as_read([mail.ident], session)
mails = yield self.app_test_client.get_mails_by_tag('inbox')
self.assertIn('read', mails[0].status)
@defer.inlineCallbacks
def test_mark_single_as_unread(self):
+ response, first_request = yield self.app_test_client.get('/', as_json=False)
+ session = first_request.getSession()
+
input_mail = MailBuilder().build_input_mail()
mail = yield self.app_test_client.add_mail_to_inbox(input_mail)
- yield self.app_test_client.mark_many_as_read([mail.ident])
+ yield self.app_test_client.mark_many_as_read([mail.ident], session)
- yield self.app_test_client.mark_many_as_unread([mail.ident])
+ yield self.app_test_client.mark_many_as_unread([mail.ident], session)
result = (yield self.app_test_client.get_mails_by_tag('inbox'))[0]
self.assertNotIn('read', result.status)
@defer.inlineCallbacks
def test_mark_many_mails_as_unread(self):
+ response, first_request = yield self.app_test_client.get('/', as_json=False)
+ session = first_request.getSession()
+
input_mail = MailBuilder().with_status([Status.SEEN]).build_input_mail()
input_mail2 = MailBuilder().with_status([Status.SEEN]).build_input_mail()
mail1 = yield self.app_test_client.add_mail_to_inbox(input_mail)
mail2 = yield self.app_test_client.add_mail_to_inbox(input_mail2)
- yield self.app_test_client.mark_many_as_read([mail1.ident, mail2.ident])
+ yield self.app_test_client.mark_many_as_read([mail1.ident, mail2.ident], session)
- yield self.app_test_client.mark_many_as_unread([mail1.ident, mail2.ident])
+ yield self.app_test_client.mark_many_as_unread([mail1.ident, mail2.ident], session)
mails = yield self.app_test_client.get_mails_by_tag('inbox')
@@ -75,7 +83,9 @@ class MarkAsReadUnreadTest(SoledadTestBase):
self.assertNotIn('read', mails[0].status)
self.assertNotIn('read', mails[1].status)
- yield self.app_test_client.mark_many_as_read([mails[0].ident, mails[1].ident])
+ response, first_request = yield self.app_test_client.get('/', as_json=False)
+ session = first_request.getSession()
+ yield self.app_test_client.mark_many_as_read([mails[0].ident, mails[1].ident], session)
mails = yield self.app_test_client.get_mails_by_tag('inbox')
@@ -84,12 +94,15 @@ class MarkAsReadUnreadTest(SoledadTestBase):
@defer.inlineCallbacks
def test_mark_mixed_status_as_read(self):
+ response, first_request = yield self.app_test_client.get('/', as_json=False)
+ session = first_request.getSession()
+
input_mail = MailBuilder().with_subject('first').build_input_mail()
input_mail2 = MailBuilder().with_subject('second').build_input_mail()
yield self.app_test_client.add_mail_to_inbox(input_mail)
mail2 = yield self.app_test_client.add_mail_to_inbox(input_mail2)
- yield self.app_test_client.mark_many_as_read([mail2.ident])
+ yield self.app_test_client.mark_many_as_read([mail2.ident], session)
mails = yield self.app_test_client.get_mails_by_tag('inbox')
@@ -98,7 +111,7 @@ class MarkAsReadUnreadTest(SoledadTestBase):
self.assertEquals(1, len(unread_mails))
self.assertEquals(1, len(read_mails))
- yield self.app_test_client.mark_many_as_read([mails[0].ident, mails[1].ident])
+ yield self.app_test_client.mark_many_as_read([mails[0].ident, mails[1].ident], session)
mails = yield self.app_test_client.get_mails_by_tag('inbox')