From df16cdcf3192bec8af453a0fb0cad5060218d9d3 Mon Sep 17 00:00:00 2001 From: Raffael Meyer Date: Fri, 19 Apr 2019 00:21:44 +0200 Subject: [PATCH] fix(test): provide a helpful error message --- erpnext/setup/doctype/company/test_company.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py index 1b08a228b6c..8debef5ff69 100644 --- a/erpnext/setup/doctype/company/test_company.py +++ b/erpnext/setup/doctype/company/test_company.py @@ -4,6 +4,8 @@ from __future__ import unicode_literals import frappe import unittest +import json +from frappe import _ from frappe.utils import random_string from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import get_charts_for_country @@ -78,7 +80,10 @@ class TestCompany(unittest.TestCase): if account_type in ["Bank", "Cash"]: filters["is_group"] = 1 - self.assertTrue(frappe.get_all("Account", filters)) + has_matching_accounts = frappe.get_all("Account", filters) + error_message = _("No Account matched these filters: {}".format(json.dumps(filters))) + + self.assertTrue(has_matching_accounts, msg=error_message) finally: self.delete_mode_of_payment(template) frappe.delete_doc("Company", template)