diff options
Diffstat (limited to 'service/test/integration/test_tags.py')
-rw-r--r-- | service/test/integration/test_tags.py | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/service/test/integration/test_tags.py b/service/test/integration/test_tags.py index d107e320..555a7382 100644 --- a/service/test/integration/test_tags.py +++ b/service/test/integration/test_tags.py @@ -31,9 +31,7 @@ class TagsTest(SoledadTestBase): input_mail = MailBuilder().with_subject('Mail with tags').build_input_mail() mail = yield self.app_test_client.add_mail_to_inbox(input_mail) - response, first_request = yield self.app_test_client.get('/', as_json=False) - session = first_request.getSession() - yield self.app_test_client.post_tags(mail.ident, self._tags_json(['IMPORTANT']), session) + yield self.app_test_client.post_tags(mail.ident, self._tags_json(['IMPORTANT'])) mails = yield self.app_test_client.get_mails_by_tag('inbox') self.assertEquals({'IMPORTANT'}, set(mails[0].tags)) @@ -43,18 +41,15 @@ class TagsTest(SoledadTestBase): @defer.inlineCallbacks def test_use_old_casing_when_same_tag_with_different_casing_is_posted(self): - response, first_request = yield self.app_test_client.get('/', as_json=False) - session = first_request.getSession() - input_mail = MailBuilder().with_subject('Mail with tags').build_input_mail() mail = yield self.app_test_client.add_mail_to_inbox(input_mail) - yield self.app_test_client.post_tags(mail.ident, self._tags_json(['ImPoRtAnT']), session) + yield self.app_test_client.post_tags(mail.ident, self._tags_json(['ImPoRtAnT'])) mails = yield self.app_test_client.get_mails_by_tag('ImPoRtAnT') self.assertEquals({'ImPoRtAnT'}, set(mails[0].tags)) another_input_mail = MailBuilder().with_subject('Mail with tags').build_input_mail() another_mail = yield self.app_test_client.add_mail_to_inbox(another_input_mail) - yield self.app_test_client.post_tags(another_mail.ident, self._tags_json(['IMPORTANT']), session) + yield self.app_test_client.post_tags(another_mail.ident, self._tags_json(['IMPORTANT'])) mails = yield self.app_test_client.get_mails_by_tag('IMPORTANT') self.assertEquals(0, len(mails)) mails = yield self.app_test_client.get_mails_by_tag('ImPoRtAnT') @@ -67,9 +62,7 @@ class TagsTest(SoledadTestBase): input_mail = MailBuilder().with_subject('Mail with tags').build_input_mail() mail = yield self.app_test_client.add_mail_to_inbox(input_mail) - response, first_request = yield self.app_test_client.get('/', as_json=False) - session = first_request.getSession() - yield self.app_test_client.post_tags(mail.ident, self._tags_json(['ImPoRtAnT']), session) + yield self.app_test_client.post_tags(mail.ident, self._tags_json(['ImPoRtAnT'])) mails = yield self.app_test_client.get_mails_by_tag('important') self.assertEquals(0, len(mails)) @@ -85,9 +78,7 @@ class TagsTest(SoledadTestBase): input_mail = MailBuilder().with_subject('Mail with tags').build_input_mail() mail = yield self.app_test_client.add_mail_to_inbox(input_mail) - response, first_request = yield self.app_test_client.get('/', as_json=False) - session = first_request.getSession() - yield self.app_test_client.post_tags(mail.ident, self._tags_json(['tag1', ' ']), session) + yield self.app_test_client.post_tags(mail.ident, self._tags_json(['tag1', ' '])) mail = yield self.app_test_client.get_mail(mail.ident) @@ -98,10 +89,8 @@ class TagsTest(SoledadTestBase): input_mail = MailBuilder().with_subject('Mail with tags').build_input_mail() mail = yield self.app_test_client.add_mail_to_inbox(input_mail) - response, first_request = yield self.app_test_client.get('/', as_json=False) - session = first_request.getSession() for tag in SPECIAL_TAGS: - response = yield self.app_test_client.post_tags(mail.ident, self._tags_json([tag.name.upper()]), session) + response = yield self.app_test_client.post_tags(mail.ident, self._tags_json([tag.name.upper()])) self.assertEquals("None of the following words can be used as tags: %s" % tag.name, response) mail = yield self.app_test_client.mail_store.get_mail(mail.ident) |