示例#1
0
    def testForClosedTask(self):
        """Tests for a mentor with a closed task assigned."""
        self.task.mentors = [self.profile.key()]
        self.task.status = 'Closed'
        self.task.put()

        result = profile_logic.canResignAsMentorForOrg(self.profile,
                                                       self.org.key())
        self.assertTrue(result)
示例#2
0
  def testForClosedTask(self):
    """Tests for a mentor with a closed task assigned."""
    self.task.mentors = [self.profile.key()]
    self.task.status = 'Closed'
    self.task.put()

    result = profile_logic.canResignAsMentorForOrg(
        self.profile, self.org.key())
    self.assertTrue(result)
示例#3
0
  def testForNonClosedTask(self):
    self.task.mentors = [self.profile.key()]
    statuses = [status for status in task_model.GCITask.status.choices
        if status != 'Closed']
    for status in statuses:
      self.task.status = status
      self.task.put()

      result = profile_logic.canResignAsMentorForOrg(
          self.profile, self.org.key())
      self.assertFalse(result)
示例#4
0
    def testForNonClosedTask(self):
        self.task.mentors = [self.profile.key()]
        statuses = [
            status for status in task_model.GCITask.status.choices
            if status != 'Closed'
        ]
        for status in statuses:
            self.task.status = status
            self.task.put()

            result = profile_logic.canResignAsMentorForOrg(
                self.profile, self.org.key())
            self.assertFalse(result)
示例#5
0
 def testForNoTasksAssigned(self):
     """Tests for a mentor with no tasks assigned."""
     result = profile_logic.canResignAsMentorForOrg(self.profile,
                                                    self.org.key())
     self.assertTrue(result)
示例#6
0
 def testForNoTasksAssigned(self):
   """Tests for a mentor with no tasks assigned."""
   result = profile_logic.canResignAsMentorForOrg(
       self.profile, self.org.key())
   self.assertTrue(result)