Exemple #1
0
    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
Exemple #2
0
 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)
Exemple #3
0
 def get_age(self):
     return get_age_from_date(self.birthday)