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)
def testTeacherToStringInputteacherReturnteacher(self): uid = "teacher" teacher = Teacher() user = User() name = uid user.username = name user.first_name = name user.last_name = name user.email = "*****@*****.**" user.password = "******" teacher.user = user self.assertEqual(str(teacher), uid)
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)