summaryrefslogtreecommitdiff
path: root/service/test
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-07-21 14:48:52 +0000
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-08-11 17:00:26 +0200
commitba1d6edfc144c0549e88392a8414a147a9f30931 (patch)
tree4a66870fb40352bb1dfbef4417761df1e2444605 /service/test
parent9b564a2529326668a0752b3b103bffc145d94417 (diff)
Fixed MarkAsReadUnreadTest#test_mark_single_as_read and underlying implementation.
Diffstat (limited to 'service/test')
-rw-r--r--service/test/integration/test_mark_as_read_unread.py11
-rw-r--r--service/test/support/integration/app_test_client.py2
2 files changed, 8 insertions, 5 deletions
diff --git a/service/test/integration/test_mark_as_read_unread.py b/service/test/integration/test_mark_as_read_unread.py
index 6119f121..896a51d1 100644
--- a/service/test/integration/test_mark_as_read_unread.py
+++ b/service/test/integration/test_mark_as_read_unread.py
@@ -14,22 +14,25 @@
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
+from twisted.internet import defer
+
from test.support.integration import SoledadTestBase, MailBuilder
from pixelated.adapter.model.status import Status
class MarkAsReadUnreadTest(SoledadTestBase):
+ @defer.inlineCallbacks
def test_mark_single_as_read(self):
input_mail = MailBuilder().build_input_mail()
- self.add_mail_to_inbox(input_mail)
+ yield self.add_mail_to_inbox(input_mail)
- mails = self.get_mails_by_tag('inbox')
+ mails = yield self.get_mails_by_tag('inbox')
self.assertNotIn('read', mails[0].status)
- self.mark_many_as_read([input_mail.ident])
+ yield self.mark_many_as_read([input_mail.ident])
- mails = self.get_mails_by_tag('inbox')
+ mails = yield self.get_mails_by_tag('inbox')
self.assertIn('read', mails[0].status)
def test_mark_single_as_unread(self):
diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py
index e139d879..a76d4948 100644
--- a/service/test/support/integration/app_test_client.py
+++ b/service/test/support/integration/app_test_client.py
@@ -214,7 +214,7 @@ class AppTestClient(object):
def mark_many_as_read(self, idents):
res, req = self.post('/mails/read', json.dumps({'idents': idents}))
- return req
+ return res
def get_contacts(self, query):
res, req = self.get('/contacts', get_args={'q': query})