def testLegitimate(self): """Attempt to check an appointment that is due now""" response = api.getAppointmentsDueNow('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 testNotNow(self): """Attempt to check an appointment that is not due now""" response = api.getAppointmentsDueNow('carer1', datetime.datetime.now()) self.assertEqual(len(response), 0)