def display(self): """ Display of the enfant. """ disp = self.e_name if self.e_birthday: disp += u", %s ans" % get_age_from_date(self.e_birthday) if self.e_school: disp += u", scolarisé à %s" % self.e_school return disp
def test_get_age_from_date(self): self.assertIsNone(python.get_age_from_date(None)) d = date.today() - timedelta(days=360*10) self.assertEquals(python.get_age_from_date(d), 9)
def get_age(self): return get_age_from_date(self.birthday)