def format_date(self, dt): return format_date(dt)
def exists_to(self): exists_to = self.model.attrs['exists_to'] return format_date(exists_to, long=False)
def exists_from(self): exists_from = self.model.attrs['exists_from'] return format_date(exists_from, long=False)
def test_format_date(self): dt = datetime(2011, 3, 15) self.assertEqual(format_date(dt), '15.03.2011 00:00') self.assertEqual(format_date(dt, long=False), '15.03.2011') self.assertEqual(format_date(object()), u'unknown')
def duration_to(self): duration_to = self.model.attrs['duration_to'] return format_date(duration_to, long=False)
def duration_from(self): duration_from = self.model.attrs['duration_from'] return format_date(duration_from, long=False)