def testLegitimate(self): """Attempt to check a appointment that is due in the next 30mins || check that API returns expected response and DB is correct too""" response = api.getAppointmentsDueIn30('patient', datetime.datetime.now()) result = {} result['creator'] = "patient" result['startdate'] = datetime.datetime.now().date() result['enddate'] = datetime.datetime.now().date() + timedelta(days=3) result['name'] = "test" result['apptype'] = "Doctors" reminder = response[0] self.assertEqual(reminder['creator'], result['creator']) self.assertEqual(reminder['startdate'], result['startdate']) self.assertEqual(reminder['enddate'], result['enddate']) self.assertEqual(reminder['name'], result['name']) self.assertEqual(reminder['apptype'], result['apptype'])
def testNotDueIn30(self): """Attempt to check appointment that is not due in the next 30mins || check that the API returns expected response and nothing has been added to the DB""" response = api.getAppointmentsDueIn30('carer1', datetime.datetime.now()) self.assertEqual(len(response), 0)