Ejemplo n.º 1
0
 def test_calc_last_admission_days_ago_returns_0_if_date_of_admission_missing(
         self):
     examination_overview = ExaminationOverview(
         ExaminationMocks.get_case_index_response_content()['examinations']
         [0])
     admission_date = None
     examination_overview.last_admission = parse_datetime(admission_date)
     result = examination_overview.calc_last_admission_days_ago()
     expected_days = 0
     self.assertEqual(result, expected_days)
Ejemplo n.º 2
0
 def test_calc_last_admission_days_ago_returns_correct_number_of_days_if_date_of_admission_present(
         self):
     examination_overview = ExaminationOverview(
         ExaminationMocks.get_case_index_response_content()['examinations']
         [0])
     admission_date = datetime.today() - timedelta(days=1)
     examination_overview.last_admission = admission_date
     result = examination_overview.calc_last_admission_days_ago()
     expected_days = 1
     self.assertEqual(result, expected_days)