Exemple #1
0
 def test_visit_datetime(self):
     visit = Visit(
         code="1000",
         rbase=relativedelta(days=0),
         rlower=relativedelta(days=0),
         rupper=relativedelta(days=6),
         timepoint=1,
     )
     visit.timepoint_datetime = datetime(2001, 12, 1)
     self.assertEqual(
         visit.timepoint_datetime,
         Arrow.fromdatetime(datetime(2001, 12, 1), tzinfo="utc"),
     )
Exemple #2
0
 def test_visit_lower_upper(self):
     visit = Visit(
         code="1000",
         rbase=relativedelta(days=0),
         rlower=relativedelta(days=0),
         rupper=relativedelta(days=6),
         timepoint=1,
     )
     visit.timepoint_datetime = Arrow.fromdatetime(
         datetime(2001, 12, 1), tzinfo="utc"
     ).datetime
     self.assertEqual(
         visit.dates.lower,
         Arrow.fromdatetime(datetime(2001, 12, 1), tzinfo="utc").datetime,
     )
     self.assertEqual(
         visit.dates.upper,
         Arrow.fromdatetime(datetime(2001, 12, 7, 23, 59), tzinfo="utc").datetime,
     )