def test_natural_key_exception(self):
"""
Tests the get_by_natural_key method when the Distillery does not exist.
"""
with LogCapture() as log_capture:
natural_key = ['elasticsearch', 'test_index', 'fake_doctype']
Distillery.objects.get_by_natural_key(*natural_key)
log_capture.check(
('warehouses.models',
'ERROR',
'Collection elasticsearch.test_index.fake_doctype does '
'not exist'),
('distilleries.models',
'ERROR',
'Distillery for Collection elasticsearch.test_index.'
'fake_doctype does not exist')
)
评论列表
文章目录