def test_it_creates_batch_indexer(self, batch_indexer, annotation_ids, celery): userid = list(annotation_ids.keys())[0] indexer.reindex_user_annotations(userid) batch_indexer.assert_any_call(celery.request.db, celery.request.es, celery.request) batch_indexer.assert_any_call(celery.request.db, celery.request.es6, celery.request)
def test_it_creates_batch_indexer(self, BatchIndexer, annotation_ids, celery): userid = list(annotation_ids.keys())[0] indexer.reindex_user_annotations(userid) BatchIndexer.assert_any_call(celery.request.db, celery.request.es, celery.request)
def test_it_reindexes_users_annotations(self, batch_indexer, annotation_ids): userid = annotation_ids.keys()[0] indexer.reindex_user_annotations(userid) args, _ = batch_indexer.return_value.index.call_args actual = args[0] expected = annotation_ids[userid] assert sorted(expected) == sorted(actual)