tests: set SITES_RULE correctly for https override

This commit is contained in:
RocketQuack 2026-01-20 13:23:30 +01:00
parent 80a11fb47f
commit a69b002881

View file

@ -26,11 +26,19 @@ def _add_version_var(name: str, env_path: Path):
def _add_sites_var(env_path: Path): def _add_sites_var(env_path: Path):
with open(env_path, "r+") as f: with open(env_path, "r+") as f:
content = f.read() content = f.read()
sites = (
"tests.localhost",
"test-erpnext-site.localhost",
"test-pg-site.localhost",
)
sites_list = ",".join(f"`{site}`" for site in sites)
sites_rule = " || ".join(f"Host(`{site}`)" for site in sites)
content = re.sub( content = re.sub(
rf"SITES=.*", rf"SITES=.*",
f"SITES=`tests.localhost`,`test-erpnext-site.localhost`,`test-pg-site.localhost`", f"SITES={sites_list}",
content, content,
) )
content = re.sub(rf"SITES_RULE=.*", f"SITES_RULE={sites_rule}", content)
f.seek(0) f.seek(0)
f.truncate() f.truncate()
f.write(content) f.write(content)