summaryrefslogtreecommitdiff
path: root/service/test
diff options
context:
space:
mode:
authorPatrick Maia <patrickjourdanmaia@gmail.com>2015-02-10 19:56:57 +0000
committerPatrick Maia <patrickjourdanmaia@gmail.com>2015-02-10 19:57:28 +0000
commitdcec274dd5d727f113bbc64a95e9fc0773829ce3 (patch)
tree26f1df7e101c100f68bb8b51c23b14145ebac3ad /service/test
parentf27a5ce3a56cb3e70adcaf21ad97d79e8c26330b (diff)
Issue #276 - uses the old casing when an existing tag with different casing is posted
Diffstat (limited to 'service/test')
-rw-r--r--service/test/integration/test_tags.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/service/test/integration/test_tags.py b/service/test/integration/test_tags.py
index 41aeeeeb..ad723067 100644
--- a/service/test/integration/test_tags.py
+++ b/service/test/integration/test_tags.py
@@ -36,6 +36,23 @@ class TagsTest(SoledadTestBase):
mails = self.get_mails_by_tag('IMPORTANT')
self.assertEquals('Mail with tags', mails[0].subject)
+ def test_use_old_casing_when_same_tag_with_different_casing_is_posted(self):
+ mail = MailBuilder().with_subject('Mail with tags').build_input_mail()
+ self.client.add_mail_to_inbox(mail)
+ self.post_tags(mail.ident, self._tags_json(['ImPoRtAnT']))
+ mails = self.get_mails_by_tag('ImPoRtAnT')
+ self.assertEquals({'ImPoRtAnT'}, set(mails[0].tags))
+
+ another_mail = MailBuilder().with_subject('Mail with tags').build_input_mail()
+ self.client.add_mail_to_inbox(another_mail)
+ self.post_tags(another_mail.ident, self._tags_json(['IMPORTANT']))
+ mails = self.get_mails_by_tag('IMPORTANT')
+ self.assertEquals(0, len(mails))
+ mails = self.get_mails_by_tag('ImPoRtAnT')
+ self.assertEquals(2, len(mails))
+ self.assertEquals({'ImPoRtAnT'}, set(mails[0].tags))
+ self.assertEquals({'ImPoRtAnT'}, set(mails[1].tags))
+
def test_tags_are_case_sensitive(self):
mail = MailBuilder().with_subject('Mail with tags').build_input_mail()
self.client.add_mail_to_inbox(mail)