'Test that fails on first reindexing exception'

def test_fail_fast_if_reindex_fails(self):

    with mock.patch(self.REINDEX_PATH_LOCATION) as patched_index:
        patched_index.side_effect = SearchIndexingError('message', [])
        with self.assertRaises(SearchIndexingError):
            call_command('reindex_library', unicode(self._get_lib_key(self.second_lib)))
