def test_item_author_name(self): """ Test the base ``item_author_name`` method. """ item = MagicMock() item.submitter = MagicMock(username='******', is_active=True) feed = LatestTicketsFeed() self.assertEqual(item.submitter.username, feed.item_author_name(item))
def test_item_author_name_anonymous(self): """ Test the base ``item_author_name`` method with an inactive user. """ item = MagicMock() item.submitter = MagicMock(username='******', is_active=False) feed = LatestTicketsFeed() self.assertEqual(_('Anonymous'), feed.item_author_name(item))