Private
Public Access
1
0

removing date.today and replacing with timezone.now

This commit is contained in:
Sander Roosendaal
2021-08-09 20:30:38 +02:00
parent ef34af1770
commit 0438d3b396
5 changed files with 61 additions and 30 deletions

View File

@@ -514,6 +514,12 @@ class DataPrepTests(TestCase):
self.assertEqual(starttime,'19:55:13')
self.assertEqual(startdate,'2021-06-15')
def test_calculate_age(self):
today = timezone.now()
born = today-datetime.timedelta(days=45+49*365.2425)
age = dataprep.calculate_age(born,today=today)
self.assertEqual(age,49)
@patch('rowers.dataprep.getsmallrowdata_db',side_effect=mocked_getsmallrowdata_uh)
def test_goldmedalstandard(self,mocked_getsmallrowdata_uh):
maxvalue, delta = dataprep.calculate_goldmedalstandard(self.r,self.wuh_otw)