Exemple #1
0
 def test_format_timedelta_0(self):
     assert_equal(format_timedelta(timedelta(seconds=0)), '0 seconds')
Exemple #2
0
 def test_format_timedelta_minutes(self):
     duration = timedelta(minutes=1, seconds=7)
     assert_equal(format_timedelta(duration), '1 minutes, 7 seconds')
Exemple #3
0
 def test_format_timedelta_days(self):
     duration = timedelta(days=2, minutes=1, seconds=8)
     assert_equal(format_timedelta(duration), '2 days, 1 minutes, 8 seconds')
Exemple #4
0
 def test_format_timedelta_none(self):
     assert_equal(format_timedelta(None), '---')
Exemple #5
0
 def test_format_timedelta_seconds(self):
     assert_equal(format_timedelta(timedelta(seconds=5)), '5 seconds')
Exemple #6
0
def test_helper_base_format_timedelta_0(settings):
    assert format_timedelta(timedelta(seconds=0)) == '0 seconds'
Exemple #7
0
def test_helper_base_format_timedelta_days(settings):
    duration = timedelta(days=2, minutes=1, seconds=8)
    assert format_timedelta(duration) == '2 days, 1 minutes, 8 seconds'
Exemple #8
0
def test_helper_base_format_timedelta_minutes(settings):
    duration = timedelta(minutes=1, seconds=7)
    assert format_timedelta(duration) == '1 minutes, 7 seconds'
Exemple #9
0
def test_helper_base_format_timedelta_seconds(settings):
    assert format_timedelta(timedelta(seconds=5)) == '5 seconds'
Exemple #10
0
def test_helper_base_format_timedelta_none(settings):
    assert format_timedelta(None) == '---'