예제 #1
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)
예제 #2
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)    
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
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)
예제 #6
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)