def test_fail_fast_if_reindex_fails(self): """ Test that fails on first reindexing exception """ with mock.patch(self.REINDEX_PATH_LOCATION) as patched_index: patched_index.side_effect = SearchIndexingError("message", []) with self.assertRaises(SearchIndexingError): call_command('reindex_course', unicode(self.second_course.id))
def test_fail_fast_if_reindex_fails(self): """ Test that fails on first reindexing exception """ with mock.patch(self.REINDEX_PATH_LOCATION) as patched_index: patched_index.side_effect = SearchIndexingError("message", []) with self.assertRaises(SearchIndexingError): call_command('reindex_library', six.text_type(self._get_lib_key(self.second_lib)))