diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-12-18 14:36:10 -0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-12-18 14:37:14 -0200 |
commit | 8e57412dcd7fe8749ebed645e048309618ed01b5 (patch) | |
tree | d736ae52d3fbffee06e482b19702c78041c83f71 /service/test/unit/controllers/mails_controller_test.py | |
parent | 2d07349df9eb7fd3a197c0c3a9f7180af441f82c (diff) |
\#203 & #204 & #205: fixing client and api for buld mark as read/unread and delete, functional tests are still broken, investigating...
Diffstat (limited to 'service/test/unit/controllers/mails_controller_test.py')
-rw-r--r-- | service/test/unit/controllers/mails_controller_test.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/service/test/unit/controllers/mails_controller_test.py b/service/test/unit/controllers/mails_controller_test.py index ab87c205..c9c2c7cf 100644 --- a/service/test/unit/controllers/mails_controller_test.py +++ b/service/test/unit/controllers/mails_controller_test.py @@ -15,6 +15,7 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import json import unittest +from io import BytesIO from klein.test_resource import requestMock from mock import MagicMock @@ -77,22 +78,24 @@ class TestMailsController(unittest.TestCase): def test_marking_mail_as_read_set_mail_as_read_on_the_service(self): mail = mock() - when(self.mail_service).mark_as_read(1).thenReturn(mail) + when(self.mail_service).mark_as_read("1").thenReturn(mail) when(self.search_engine).index_mail(mail).thenReturn(None) + self.dummy_request.content = BytesIO('{"idents":["1"]}') - self.mails_controller.mark_mail_as_read(None, 1) + self.mails_controller.mark_many_mail_read(self.dummy_request) - verify(self.mail_service).mark_as_read(1) + verify(self.mail_service).mark_as_read(u'1') verify(self.search_engine).index_mail(mail) def test_marking_mail_as_unread_set_mail_as_unread_on_the_service(self): mail = mock() - when(self.mail_service).mark_as_unread(1).thenReturn(mail) + when(self.mail_service).mark_as_unread("1").thenReturn(mail) when(self.search_engine).index_mail(mail).thenReturn(None) + self.dummy_request.content = BytesIO('{"idents":["1"]}') - self.mails_controller.mark_mail_as_unread(None, 1) + self.mails_controller.mark_many_mail_unread(self.dummy_request) - verify(self.mail_service).mark_as_unread(1) + verify(self.mail_service).mark_as_unread(u'1') verify(self.search_engine).index_mail(mail) def test_move_message_to_trash(self): |