Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)