示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)