From dcec274dd5d727f113bbc64a95e9fc0773829ce3 Mon Sep 17 00:00:00 2001 From: Patrick Maia Date: Tue, 10 Feb 2015 19:56:57 +0000 Subject: Issue #276 - uses the old casing when an existing tag with different casing is posted --- service/test/integration/test_tags.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'service/test') 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) -- cgit v1.2.3