def testInsertOneSchedule(self): aDateFrom = datetime.date(year=2014, month=4, day=27) aDateTo = datetime.date(year=2014, month=7, day=27) anAppointmentLength = datetime.time(minute=20) aProHouse = Professional(key_name="123", name="Gregory", lastName="House", email="*****@*****.**", licenseNumber=123) aProHouse.put() aConsultingRoom = ConsultingRoom(key_name="1", description="Consultorio 1", identification="1") aConsultingRoom.put() aSchedule = Schedule(dateFrom=aDateFrom, dateTo=aDateTo, appointmentLength=anAppointmentLength, professional=aProHouse, consultingRoom=aConsultingRoom) aSchedule.put() self.assertEqual(1, len(Schedule.all().fetch(None)))
def get(self): listOfSchedule = Schedule.all().fetch(None) self.response.out.write(self.returnObjectOrResult( resultCode="404", objectToReturn=listOfSchedule, encoderForObject=ScheduleEncoder()))
def delete(self): for aSchedule in Schedule.all().fetch(None): aSchedule.delete() self.response.out.write(self.returnObjectOrResult(resultCode="200"))