def test_decrements_total_count_and_removes_mails_id_from_mails(self): tag = Tag('one_more') tag.mails = set([12]) tag.decrement(12) self.assertNotIn(12, tag.mails) self.assertEquals(0, tag.total)
def test_as_dict_puts_all_tag_attributes_in_the_returning_dict(self): tag = Tag('some_tag', default=True) tag.counts = {'total': 0, 'read': 0, 'starred': 0, 'replied': 0} tag.mails = [1, 2, 3] tag_dict = tag.as_dict() self.assertEquals(tag.name, tag_dict['name']) self.assertEquals(tag.default, tag_dict['default']) self.assertEquals(tag.total, tag_dict['counts']['total']) self.assertEquals(tag.mails, tag_dict['mails'])
def test_increment_does_nothing_if_mail_already_has_the_tag(self): tag = Tag('tag') tag.mails = set([12]) tag.increment(12) self.assertEquals(1, tag.total)