Example #1
0
 def test_calc_created_days_ago_returns_correct_number_of_days_if_case_created_date_present(
         self):
     examination_overview = ExaminationOverview(
         ExaminationMocks.get_case_index_response_content()['examinations']
         [0])
     case_created_date = datetime.today() - timedelta(days=1)
     examination_overview.case_created_date = case_created_date
     result = examination_overview.calc_created_days_ago()
     expected_days = 1
     self.assertEqual(result, expected_days)
Example #2
0
 def test_calc_created_days_ago_returns_0_if_case_created_date_missing(
         self):
     examination_overview = ExaminationOverview(
         ExaminationMocks.get_case_index_response_content()['examinations']
         [0])
     case_created_date = None
     examination_overview.case_created_date = parse_datetime(
         case_created_date)
     result = examination_overview.calc_created_days_ago()
     expected_days = 0
     self.assertEqual(result, expected_days)