def three_indexed_records(app, identity_simple, es): # NOTE: We make use of es fixture (and not es_clear) here because all tests # assume 3 records have been indexed and NO tests in this module # adds/deletes any. service = RecordService(ServiceConfig) for i in range(3): data = { 'metadata': { 'title': f"Test foo {i}", }, } service.create(identity_simple, data) Record.index.refresh()
def three_indexed_records(app, identity_simple, es): # NOTE: We make use of es fixture (and not es_clear) here because all tests # assume 3 records have been indexed and NO tests in this module # adds/deletes any. input_data = { 'metadata': { 'title': 'Test' }, } service = RecordService(ServiceConfig) title_parts = [ "The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" ] title_parts_len = len(title_parts) units = [] for i in range(3): data = deepcopy(input_data) data["metadata"]["title"] = " ".join(title_parts[:title_parts_len - 3 * i]) time.sleep(0.01) units += [service.create(identity_simple, data)] Record.index.refresh() return units