'Test that the group id is only included when a privileged user requests user profile information for a
particular course and user if the group_id is explicitly passed in.'

def test_group_id_user_profile_moderator(self, mock_request):

    def verify_group_id_present(profiled_user, pass_group_id, requested_cohort=self.moderator_cohort):
        '\n                                                Helper    method    to    verify    that    group_id    is    present.\n                                                '
        self._test_group_id_passed_to_user_profile(mock_request, True, self.moderator, profiled_user, requested_cohort.id, pass_group_id)
    def verify_group_id_not_present(profiled_user, pass_group_id, requested_cohort=self.moderator_cohort):
        '\n                                                Helper    method    to    verify    that    group_id    is    not    present.\n                                                '
        self._test_group_id_passed_to_user_profile(mock_request, False, self.moderator, profiled_user, requested_cohort.id, pass_group_id)
    verify_group_id_present(profiled_user=self.student, pass_group_id=True)
    verify_group_id_present(profiled_user=self.moderator, pass_group_id=True)
    verify_group_id_present(profiled_user=self.student, pass_group_id=True, requested_cohort=self.student_cohort)
    verify_group_id_not_present(profiled_user=self.student, pass_group_id=False)
    verify_group_id_not_present(profiled_user=self.moderator, pass_group_id=False)
