test: Add test case to validate aggregation
- based on child table field
This commit is contained in:
parent
14ae20bdb8
commit
8febefae9c
1 changed files with 16 additions and 0 deletions
|
|
@ -446,6 +446,22 @@ class TestReportview(unittest.TestCase):
|
|||
user.remove_roles("Blogger", "Website Manager")
|
||||
user.add_roles(*user_roles)
|
||||
|
||||
def test_reportview_get_aggregation(self):
|
||||
# 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`"]""",
|
||||
"filters": "[]",
|
||||
"order_by": "_aggregate_column desc",
|
||||
"start": 0,
|
||||
"page_length": 20,
|
||||
"view": "Report",
|
||||
"with_comment_count": 0,
|
||||
"group_by": "`tabDocField`.`hidden`, columns"
|
||||
})
|
||||
|
||||
response = execute_cmd("frappe.desk.reportview.get")
|
||||
self.assertListEqual(response["keys"], ["hidden", "_aggregate_column", "columns"])
|
||||
|
||||
def add_child_table_to_blog_post():
|
||||
child_table = frappe.get_doc({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue