test: Update aggregation test

This commit is contained in:
Suraj Shetty 2021-10-12 13:36:30 +05:30
parent ab00980389
commit 74ec9657da

View file

@ -450,18 +450,21 @@ class TestReportview(unittest.TestCase):
# test aggregation based on child table field
frappe.local.form_dict = frappe._dict({
"doctype": "DocType",
"fields": """["`tabDocField`.`hidden` as hidden","sum(`tabDocField`.`columns`) as _aggregate_column","`tabDocField`.`columns`"]""",
"fields": """["`tabDocField`.`label` as field_label","`tabDocField`.`name` as field_name"]""",
"filters": "[]",
"order_by": "_aggregate_column desc",
"start": 0,
"page_length": 20,
"view": "Report",
"with_comment_count": 0,
"group_by": "`tabDocField`.`hidden`, columns"
"group_by": "field_label, field_name",
"aggregate_on_field": "columns",
"aggregate_on_doctype": "DocField",
"aggregate_function": "sum"
})
response = execute_cmd("frappe.desk.reportview.get")
self.assertListEqual(response["keys"], ["hidden", "_aggregate_column", "columns"])
self.assertListEqual(response["keys"], ["field_label", "field_name", "_aggregate_column"])
def add_child_table_to_blog_post():
child_table = frappe.get_doc({