def test_is_empty(self): from nuvavaalit.models import Candidate empty = Candidate(Candidate.EMPTY_CANDIDATE, u'Empty', u'candidate', u'', u'') self.assertTrue(empty.is_empty()) real = Candidate(69, u'Real', u'McCoy', u'', u'') self.assertNotEqual(69, Candidate.EMPTY_CANDIDATE) self.assertFalse(real.is_empty())
def test_fullname__lastname_only(self): from nuvavaalit.models import Candidate candidate = Candidate(69, u'Reäl', u'', u'', u'') self.assertEquals(u'Reäl', candidate.fullname())
def test_fullname__both_names(self): from nuvavaalit.models import Candidate candidate = Candidate(69, u'Reäl', u'McCöy', u'', u'') self.assertEquals(u'McCöy, Reäl', candidate.fullname())