'Test json response with mocked error data for html'

@mock.patch('xmodule.html_module.HtmlDescriptor.index_dictionary')
def test_reindex_course_search_index_error(self, mock_index_dictionary):

    err = SearchIndexingError
    mock_index_dictionary.return_value = err
    index_url = reverse_course_url('course_search_index_handler', self.course.id)
    response = self.client.get(index_url, {}, HTTP_ACCEPT='application/json')
    self.assertEqual(response.status_code, 500)
