def testCreationTeacherCompareUid(self): uid = "teacher" teacher = Teacher() teacher.uid = uid teacher.appointment = uid teacher.user = User.objects.get(username="******") teacher.save() c_teacher = Teacher.objects.get(uid=uid) self.assertEqual(c_teacher.uid, uid)
def testCreationWithoutUserCatchException(self): msg = "Teacher cannot be saved without an authentication register. Please, give the teacher an associated user so he can login." name = "teacher" teacher = Teacher() teacher.iud = name try: teacher.save() assert False except Exception: self.assert_(msg, Exception.message)
def testCreationWithoutUserCatchException(self): msg = 'Teacher cannot be saved without an authentication register. Please, give the teacher an associated user so he can login.' name = "teacher" teacher = Teacher() teacher.iud = name try: teacher.save() assert(False) except Exception: self.assert_(msg, Exception.message)