Merge pull request #27740 from frappe/chore/simplify-config-calling

chore: simplify config calling
This commit is contained in:
David Arnold 2024-09-11 23:37:18 +02:00 committed by GitHub
commit ddeb612dc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -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}"

View file

@ -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