From 2c19e7acbfb238e4fcd17725142c7ae9c43a3a77 Mon Sep 17 00:00:00 2001 From: Lisa Junger Date: Tue, 6 Jan 2015 14:26:39 +0100 Subject: Issue #183 adds ALL to special tags. --- service/pixelated/adapter/model/tag.py | 2 +- service/pixelated/adapter/services/tag_service.py | 2 +- service/test/integration/tags_test.py | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/service/pixelated/adapter/model/tag.py b/service/pixelated/adapter/model/tag.py index d75022f9..ca62a1fe 100644 --- a/service/pixelated/adapter/model/tag.py +++ b/service/pixelated/adapter/model/tag.py @@ -17,7 +17,7 @@ import json -class Tag: +class Tag(object): @classmethod def from_dict(cls, tag_dict): diff --git a/service/pixelated/adapter/services/tag_service.py b/service/pixelated/adapter/services/tag_service.py index c723b04c..22cfb051 100644 --- a/service/pixelated/adapter/services/tag_service.py +++ b/service/pixelated/adapter/services/tag_service.py @@ -19,7 +19,7 @@ from pixelated.adapter.model.tag import Tag class TagService: instance = None - SPECIAL_TAGS = {Tag('inbox', True), Tag('sent', True), Tag('drafts', True), Tag('trash', True)} + SPECIAL_TAGS = {Tag('inbox', True), Tag('sent', True), Tag('drafts', True), Tag('trash', True), Tag('ALL', True)} @classmethod def extract_reserved(cls, tags): diff --git a/service/test/integration/tags_test.py b/service/test/integration/tags_test.py index 03d6f4b3..6072392c 100644 --- a/service/test/integration/tags_test.py +++ b/service/test/integration/tags_test.py @@ -16,6 +16,7 @@ import json from test.support.integration import * +from pixelated.adapter.services.tag_service import TagService class TagsTest(SoledadTestBase): @@ -45,8 +46,9 @@ class TagsTest(SoledadTestBase): mail = MailBuilder().with_subject('Mail with tags').build_input_mail() self.client.add_mail_to_inbox(mail) - response = self.post_tags(mail.ident, self._tags_json(['DRAFTS'])) - self.assertEquals("None of the following words can be used as tags: drafts", response) + for tag in TagService.SPECIAL_TAGS: + response = self.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 = self.client.mailboxes.inbox().mail(mail.ident) self.assertNotIn('drafts', mail.tags) -- cgit v1.2.3