fix: allow whitelist_for_tests in CI environment

The CI check was incorrectly nested inside the dev_server condition,
preventing test endpoints from being accessible during CI runs using
bench execute. Now CI is checked independently.
This commit is contained in:
Sagar Vora 2025-11-21 17:01:06 +05:30
parent eac218216b
commit 11235f6b3a

View file

@ -25,7 +25,7 @@ def whitelist_for_tests(**whitelist_kwargs):
@wraps(fn)
def wrapper(*args, **kwargs):
if not (
frappe.in_test or (frappe._dev_server and (frappe.conf.allow_tests or os.environ.get("CI")))
frappe.in_test or (frappe._dev_server and frappe.conf.allow_tests) or os.environ.get("CI")
):
frappe.throw( # nosemgrep: frappe-missing-translate-function-python
'Test endpoints are only available when running in test mode or running a development server ("bench start") with the "allow_tests" site config enabled'