better totaltimetosec
This commit is contained in:
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
from rowers.mytypes import rowtypes
|
||||
from rowers.utils import allmonths,allsundays
|
||||
from rowers.utils import allmonths,allsundays, totaltime_sec_to_string
|
||||
from rowers.models import update_records
|
||||
|
||||
from django.db import transaction
|
||||
@@ -94,6 +94,25 @@ class OtherUnitTests(TestCase):
|
||||
# time zone should be US/Pacific
|
||||
self.assertTrue('US/Pacific' in str(startdate.tzinfo))
|
||||
|
||||
def test_totaltime_sec_to_string(self):
|
||||
results = (
|
||||
(0,"0:00"),
|
||||
(120,"2:00"),
|
||||
(3634.2,"1:00:34"),
|
||||
)
|
||||
|
||||
for duration, expected in results:
|
||||
self.assertEqual(totaltime_sec_to_string(duration, shorten=True), expected)
|
||||
|
||||
results = (
|
||||
(0,"00:00:00.0"),
|
||||
(120,"00:02:00.0"),
|
||||
(3634.2,"01:00:34.2"),
|
||||
)
|
||||
|
||||
for duration, expected in results:
|
||||
self.assertEqual(totaltime_sec_to_string(duration, shorten=False), expected)
|
||||
|
||||
|
||||
|
||||
def test_summaryfromsplitdata(self):
|
||||
|
||||
Reference in New Issue
Block a user