def testForStudentProfile(self): # make the profile invalid profile = profile_utils.seedSOCStudent(self.program) # student profiles cannot become mentors can_become = profile_logic.canBecomeMentor(profile) self.assertFalse(can_become)
def testForOrgAdmin(self): # make the profile an org admin for organization profile = profile_utils.seedNDBProfile( self.program.key(), admin_for=[self.organization.key]) # profile with an org admin role can still become a mentor can_become = profile_logic.canBecomeMentor(profile) self.assertTrue(can_become)
def testForMentor(self): # make the profile a mentor for organization self.profile.mentor_for = [self.organization.key] self.profile.put() # profile with a mentor role can still become a mentor can_become = profile_logic.canBecomeMentor(self.profile) self.assertTrue(can_become)
def testForInvalidProfile(self): # make the profile invalid self.profile.status = profile_model.Status.BANNED self.profile.put() # invalid profiles cannot become mentors can_become = profile_logic.canBecomeMentor(self.profile) self.assertFalse(can_become)
def testForLoneProfile(self): # profile with no roles can become mentors can_become = profile_logic.canBecomeMentor(self.profile) self.assertTrue(can_become)