예제 #1
0
  def testHasTasks(self):
    """Tests profile_logic.hasTasks."""
    student_properties = {'is_student': True}
    student = seeder_logic.seed(GCIProfile, student_properties)

    # Student hasn't been assigned any task.
    self.assertFalse(profile_logic.hasTasks(student))

    mentor_properties = {'mentor_for': [self.foo_org.key()],
                         'is_mentor': True}
    foo_mentor = seeder_logic.seed(GCIProfile, mentor_properties)

    task_utils.seedTask(
        self.program, self.foo_org, [foo_mentor.key()], student=student,
        status=task_model.CLAIMED)

    # Student has been assigned one task.
    self.assertTrue(profile_logic.hasTasks(student))
예제 #2
0
    def testHasTasks(self):
        """Tests profile_logic.hasTasks."""
        student_properties = {'is_student': True}
        student = seeder_logic.seed(GCIProfile, student_properties)

        # Student hasn't been assigned any task.
        self.assertFalse(profile_logic.hasTasks(student))

        mentor_properties = {
            'mentor_for': [self.foo_org.key()],
            'is_mentor': True
        }
        foo_mentor = seeder_logic.seed(GCIProfile, mentor_properties)

        task_utils.seedTask(self.program,
                            self.foo_org, [foo_mentor.key()],
                            student=student,
                            status=task_model.CLAIMED)

        # Student has been assigned one task.
        self.assertTrue(profile_logic.hasTasks(student))
  def context(self, data, check, mutator):
    profile = data.url_profile

    return {
        'page_name': 'Moderate delete account requests',
        'profile': profile,
        'has_tasks': profile_logic.hasTasks(profile),
        'has_created_or_modified_tasks': profile_logic.hasCreatedOrModifiedTask(
            profile),
        'has_task_comments': profile_logic.hasTaskComments(profile),
        'has_other_gci_profiles': profile_logic.hasOtherGCIProfiles(profile),
        'has_other_gsoc_profiles': profile_logic.hasOtherGSoCProfiles(profile),
        }
    def context(self, data, check, mutator):
        profile = data.url_profile

        return {
            'page_name':
            'Moderate delete account requests',
            'profile':
            profile,
            'has_tasks':
            profile_logic.hasTasks(profile),
            'has_created_or_modified_tasks':
            profile_logic.hasCreatedOrModifiedTask(profile),
            'has_task_comments':
            profile_logic.hasTaskComments(profile),
            'has_other_gci_profiles':
            profile_logic.hasOtherGCIProfiles(profile),
            'has_other_gsoc_profiles':
            profile_logic.hasOtherGSoCProfiles(profile),
        }