def testInsertOneConsultingChangeDescriptionAndIsOnlyOneConsulting(self):
     theConsulting123 = ConsultingRoom(key_name="123", description="Consultorio123",
                                       identification="123")
     theConsulting123.put()
     theConsulting123 = ConsultingRoom.get_by_key_name(theConsulting123.identification)
     theConsulting123.description = "Nueva descripcion"
     theConsulting123.put()
     self.assertEqual(1, len(ConsultingRoom.all().fetch(None)))
 def testOneConsultingWithSameKeyNameOverWriteThePreviousInsert(self):
     theConsulting123 = ConsultingRoom(key_name="123", description="Consultorio123",
                                       identification="123")
     theConsulting123.put()
     otherConsulting123 = ConsultingRoom(key_name="123", description="OtroConsultorio123",
                                         identification="123")
     otherConsulting123.put()
     theConsultingFromDB = ConsultingRoom.get_by_key_name(theConsulting123.identification)
     self.assertNotEqual(theConsulting123.description, theConsultingFromDB.description)
 def testInsertOneConsultingAndChangeDescription(self):
     theConsulting123 = ConsultingRoom(key_name="123", description="Consultorio123",
                                       identification="123")
     theConsulting123.put()
     theConsulting123 = ConsultingRoom.get_by_key_name(theConsulting123.identification)
     theConsulting123.description = "Nueva descripcion"
     theConsulting123.put()
     theConsulting123 = ConsultingRoom.get_by_key_name(theConsulting123.identification)
     self.assertEqual("Nueva descripcion", theConsulting123.description)
 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 testInsertOneConsultingRoomAndGet(self):
     theConsulting123 = ConsultingRoom(key_name="123", description="Consultorio123",
                                       identification="123")
     theConsulting123.put()
     theConsulting123FromDB = ConsultingRoom.get_by_key_name(theConsulting123.identification)
     self.assertEqual(theConsulting123.identification, theConsulting123FromDB.identification)