diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index b2d9a54532..50aae06990 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -792,7 +792,8 @@ def run_tests( tests = test site = get_site(context) - allow_tests = frappe.get_conf(site).allow_tests + frappe.init(site) + allow_tests = frappe.get_conf().allow_tests if not (allow_tests or os.environ.get("CI")): click.secho("Testing is disabled for the site!", bold=True) @@ -897,7 +898,7 @@ def run_ui_tests( frappe.init(site) app_base_path = frappe.get_app_source_path(app) site_url = frappe.utils.get_site_url(site) - admin_password = frappe.get_conf(site).admin_password + admin_password = frappe.get_conf().admin_password # override baseUrl using env variable site_env = f"CYPRESS_baseUrl={site_url}" diff --git a/frappe/tests/utils.py b/frappe/tests/utils.py index 0f72016ae7..628b4cd067 100644 --- a/frappe/tests/utils.py +++ b/frappe/tests/utils.py @@ -115,6 +115,7 @@ class FrappeTestCase(unittest.TestCase): @classmethod def setUpClass(cls) -> None: cls.TEST_SITE = getattr(frappe.local, "site", None) or cls.TEST_SITE + frappe.init(cls.TEST_SITE) cls.ADMIN_PASSWORD = frappe.get_conf(cls.TEST_SITE).admin_password cls._primary_connection = frappe.local.db cls._secondary_connection = None