From 6244ef377aace0659c088f6c95878ec8aeb0cd02 Mon Sep 17 00:00:00 2001 From: Patrick Maia Date: Wed, 1 Oct 2014 11:59:29 -0300 Subject: #53 - does not allow reserved names in tags --- service/integration/tags_test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'service/integration/tags_test.py') diff --git a/service/integration/tags_test.py b/service/integration/tags_test.py index a0743b6a..eb278a71 100644 --- a/service/integration/tags_test.py +++ b/service/integration/tags_test.py @@ -33,7 +33,7 @@ class TagsTest(unittest.TestCase, SoledadTestBase): mail = MailBuilder().with_subject('Mail with tags').build_input_mail() self.pixelated_mailboxes.inbox().add(mail) - self.post_tags(mail.ident, self._tags_json(['INBOX', 'IMPORTANT'])) + self.post_tags(mail.ident, self._tags_json(['IMPORTANT'])) mails = self.get_mails_by_tag('inbox') self.assertEquals({'inbox', 'important'}, set(mails[0].tags)) @@ -41,4 +41,12 @@ class TagsTest(unittest.TestCase, SoledadTestBase): mails = self.get_mails_by_tag('important') self.assertEquals('Mail with tags', mails[0].subject) + def test_addition_of_reserved_tags_is_not_allowed(self): + mail = MailBuilder().with_subject('Mail with tags').build_input_mail() + self.pixelated_mailboxes.inbox().add(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) + mail = self.pixelated_mailboxes.inbox().mail(mail.ident) + self.assertNotIn('drafts', mail.tags) -- cgit v1.2.3