'Test do_course_reindex response with mocked error data for video'

@mock.patch('xmodule.video_module.VideoDescriptor.index_dictionary')
def test_indexing_video_error_responses(self, mock_index_dictionary):

    response = perform_search('unique', user=self.user, size=10, from_=0, course_id=unicode(self.course.id))
    self.assertEqual(response['total'], 1)
    err = Exception
    mock_index_dictionary.return_value = err
    with self.assertRaises(SearchIndexingError):
        CoursewareSearchIndexer.do_course_reindex(modulestore(), self.course.id)
