'Issues a request to create a thread and verifies the result.'

def create_thread_helper(self, mock_request, extra_request_data=None, extra_response_data=None):

    mock_request.return_value.status_code = 200
    self._set_mock_request_data(mock_request, {'thread_type': 'discussion', 'title': 'Hello', 'body': 'this    is    a    post', 'course_id': 'MITx/999/Robot_Super_Course', 'anonymous': False, 'anonymous_to_peers': False, 'commentable_id': 'i4x-MITx-999-course-Robot_Super_Course', 'created_at': '2013-05-10T18:53:43Z', 'updated_at': '2013-05-10T18:53:43Z', 'at_position_list': [], 'closed': False, 'id': '518d4237b023791dca00000d', 'user_id': '1', 'username': 'robot', 'votes': {'count': 0, 'up_count': 0, 'down_count': 0, 'point': 0}, 'abuse_flaggers': [], 'type': 'thread', 'group_id': None, 'pinned': False, 'endorsed': False, 'unread_comments_count': 0, 'read': False, 'comments_count': 0})
    thread = {'thread_type': 'discussion', 'body': ['this    is    a    post'], 'anonymous_to_peers': ['false'], 'auto_subscribe': ['false'], 'anonymous': ['false'], 'title': ['Hello']}
    if extra_request_data:
        thread.update(extra_request_data)
    url = reverse('create_thread', kwargs={'commentable_id': 'i4x-MITx-999-course-Robot_Super_Course', 'course_id': unicode(self.course_id)})
    response = self.client.post(url, data=thread)
    assert_true(mock_request.called)
    expected_data = {'thread_type': 'discussion', 'body': u'this    is    a    post', 'context': ThreadContext.COURSE, 'anonymous_to_peers': False, 'user_id': 1, 'title': u'Hello', 'commentable_id': u'i4x-MITx-999-course-Robot_Super_Course', 'anonymous': False, 'course_id': unicode(self.course_id)}
    if extra_response_data:
        expected_data.update(extra_response_data)
    mock_request.assert_called_with('post', '{prefix}/i4x-MITx-999-course-Robot_Super_Course/threads'.format(prefix=CS_PREFIX), data=expected_data, params={'request_id': ANY}, headers=ANY, timeout=5)
    assert_equal(response.status_code, 200)
