示例#1
0
  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)
示例#2
0
  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)
示例#3
0
  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)
示例#4
0
  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)
示例#5
0
 def testForLoneProfile(self):
   # profile with no roles can become mentors
   can_become = profile_logic.canBecomeMentor(self.profile)
   self.assertTrue(can_become)