summaryrefslogtreecommitdiff
path: root/service/test/integration/test_tags.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/test/integration/test_tags.py')
-rw-r--r--service/test/integration/test_tags.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/service/test/integration/test_tags.py b/service/test/integration/test_tags.py
index 555a7382..d107e320 100644
--- a/service/test/integration/test_tags.py
+++ b/service/test/integration/test_tags.py
@@ -31,7 +31,9 @@ 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)
- yield self.app_test_client.post_tags(mail.ident, self._tags_json(['IMPORTANT']))
+ 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)
mails = yield self.app_test_client.get_mails_by_tag('inbox')
self.assertEquals({'IMPORTANT'}, set(mails[0].tags))
@@ -41,15 +43,18 @@ 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']))
+ yield self.app_test_client.post_tags(mail.ident, self._tags_json(['ImPoRtAnT']), session)
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']))
+ yield self.app_test_client.post_tags(another_mail.ident, self._tags_json(['IMPORTANT']), session)
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')
@@ -62,7 +67,9 @@ 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)
- yield self.app_test_client.post_tags(mail.ident, self._tags_json(['ImPoRtAnT']))
+ 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)
mails = yield self.app_test_client.get_mails_by_tag('important')
self.assertEquals(0, len(mails))
@@ -78,7 +85,9 @@ 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)
- yield self.app_test_client.post_tags(mail.ident, self._tags_json(['tag1', ' ']))
+ 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)
mail = yield self.app_test_client.get_mail(mail.ident)
@@ -89,8 +98,10 @@ 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()]))
+ response = yield self.app_test_client.post_tags(mail.ident, self._tags_json([tag.name.upper()]), session)
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)