def describe_seconds(value):
    """
    Convert a seconds value into a human readable (ie week, day, hour) value.
    :param value: integer value of the number of seconds.
    :return: a string with the humanized value.
    """
    return humanize.describe_seconds(value)
def describe_seconds(value):
    """
    Convert a seconds value into a human readable (ie week, day, hour) value.
    :param value: integer value of the number of seconds.
    :return: a string with the humanized value.
    """
    return humanize.describe_seconds(value)
Exemple #3
0
 def test_minutes(self):
     self.assertEqual('12m', humanize.describe_seconds(720))
Exemple #4
0
 def test_seconds(self):
     self.assertEqual('12s', humanize.describe_seconds(12))
Exemple #5
0
 def test_mix_it_up(self):
     self.assertEqual('2w 3d 14h 42s', humanize.describe_seconds(1519242))
Exemple #6
0
 def test_all_one(self):
     self.assertEqual('1w 1d 1h 1m 1s', humanize.describe_seconds(694861))
Exemple #7
0
 def test_weeks(self):
     self.assertEqual('12w', humanize.describe_seconds(7257600))
Exemple #8
0
 def test_days(self):
     self.assertEqual('5d', humanize.describe_seconds(432000))
Exemple #9
0
 def test_hours(self):
     self.assertEqual('12h', humanize.describe_seconds(43200))