def test_remove(self):
""" Test removing an object from the search index.
Removing an object from the search index should make it
inaccessible to elasticsearch.
"""
thread = create_thread()
self.backend.add(thread)
self.backend.remove(thread)
es = Elasticsearch([{'host': 'localhost', 'port': 9200}])
with self.assertRaises(NotFoundError):
es.get_source(
index=self.backend.index,
doc_type='thread',
id=thread.pk)
test_search_backends.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录