def test_remove_message(self):
""" Test removing a thread with messages.
If a thread has messages assocated with it, those messages
should be removed from the search backend when the thread
instance is removed.
"""
thread = create_thread()
message = create_message(thread=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='message',
id=message.pk)
test_search_backends.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录