def test_getAuthor_extant(self): context = self._makeRoot() profile = self._makeContext() profile.__name__ = 'extant' by_email = {'*****@*****.**': profile} pf = context['profiles'] = self._makeContext() pf.getProfileByEmail = lambda email: by_email.get(email) mailin = self._makeOne(context) self.assertEqual(mailin.getAuthor('*****@*****.**'), 'extant')
def test_getAuthor_nonesuch(self): context = self._makeRoot() pf = context['profiles'] = self._makeContext() pf.getProfileByEmail = lambda email: None mailin = self._makeOne(context) self.assertEqual(mailin.getAuthor('*****@*****.**'), None)