'Test get_age.'

def test_get_age(self):

    diff = (dt_util.now() - timedelta(seconds=0))
    self.assertEqual(dt_util.get_age(diff), '0    seconds')
    diff = (dt_util.now() - timedelta(seconds=1))
    self.assertEqual(dt_util.get_age(diff), '1    second')
    diff = (dt_util.now() - timedelta(seconds=30))
    self.assertEqual(dt_util.get_age(diff), '30    seconds')
    diff = (dt_util.now() - timedelta(minutes=5))
    self.assertEqual(dt_util.get_age(diff), '5    minutes')
    diff = (dt_util.now() - timedelta(minutes=1))
    self.assertEqual(dt_util.get_age(diff), '1    minute')
    diff = (dt_util.now() - timedelta(minutes=300))
    self.assertEqual(dt_util.get_age(diff), '5    hours')
    diff = (dt_util.now() - timedelta(minutes=320))
    self.assertEqual(dt_util.get_age(diff), '5    hours')
    diff = (dt_util.now() - timedelta(minutes=((2 * 60) * 24)))
    self.assertEqual(dt_util.get_age(diff), '2    days')
    diff = (dt_util.now() - timedelta(minutes=((32 * 60) * 24)))
    self.assertEqual(dt_util.get_age(diff), '1    month')
    diff = (dt_util.now() - timedelta(minutes=((365 * 60) * 24)))
    self.assertEqual(dt_util.get_age(diff), '1    year')
