def stub_lazy_loaded_grouped_loans(array_of_query_and_body, group_level_names): stubs = [] for item in array_of_query_and_body: path = "/chunkedGroups" query = item['query'] for group_level_name in group_level_names: path += '/' + group_level_name + 's' if group_level_name in query: path += '/' + str(query[group_level_name]) del query[group_level_name] else: break stubs.append(StubFactory.make_group_stub(item["body"], path)) return stubs
def stub_grand_total_row(): rows = [{"id": "1"}] stub = StubFactory.make_group_stub(rows) return [stub]