def test_recreate_index(self):
clear_elasticsearch_index()
sb = connections['elasticsearch'].get_backend()
sb.silently_fail = True
sb.setup()
original_mapping = self.raw_es.indices.get_mapping(index=sb.index_name)
sb.clear()
sb.setup()
try:
updated_mapping = self.raw_es.indices.get_mapping(sb.index_name)
except elasticsearch.NotFoundError:
self.fail("There is no mapping after recreating the index")
self.assertEqual(original_mapping, updated_mapping,
"Mapping after recreating the index differs from the original one")
test_elasticsearch_backend.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录