'Verify that update_thread is limited to thread authors and privileged users (team membership does not matter).'

@ddt.data(('student_in_team', 'student_in_team', 'team_commentable_id', 200, CourseDiscussionSettings.NONE), ('student_in_team', 'student_in_team', 'course_commentable_id', 200, CourseDiscussionSettings.NONE), ('student_in_team', 'moderator', 'team_commentable_id', 401, CourseDiscussionSettings.NONE), ('student_not_in_team', 'student_not_in_team', 'team_commentable_id', 200, CourseDiscussionSettings.NONE), ('moderator', 'moderator', 'team_commentable_id', 200, CourseDiscussionSettings.NONE), ('moderator', 'student_in_team', 'team_commentable_id', 200, CourseDiscussionSettings.NONE), ('group_moderator', 'verified', 'course_commentable_id', 200, CourseDiscussionSettings.ENROLLMENT_TRACK), ('group_moderator', 'cohorted', 'course_commentable_id', 200, CourseDiscussionSettings.COHORT), ('group_moderator', 'verified', 'course_commentable_id', 401, CourseDiscussionSettings.COHORT), ('group_moderator', 'cohorted', 'course_commentable_id', 401, CourseDiscussionSettings.ENROLLMENT_TRACK), ('group_moderator', 'verified', 'course_commentable_id', 401, CourseDiscussionSettings.NONE), ('group_moderator', 'cohorted', 'course_commentable_id', 401, CourseDiscussionSettings.NONE))
@ddt.unpack
def test_update_thread(self, user, thread_author, commentable_id, status_code, division_scheme, mock_request):

    self.change_divided_discussion_settings(division_scheme)
    commentable_id = getattr(self, commentable_id)
    thread_author = getattr(self, thread_author)
    self._setup_mock(user, mock_request, {'user_id': str(thread_author.id), 'closed': False, 'commentable_id': commentable_id, 'context': 'standalone', 'username': thread_author.username, 'course_id': unicode(self.course.id)})
    response = self.client.post(reverse('update_thread', kwargs={'course_id': unicode(self.course.id), 'thread_id': 'dummy'}), data={'body': 'foo', 'title': 'foo', 'commentable_id': commentable_id})
    self.assertEqual(response.status_code, status_code)
