Sometimes test hang up and time out due to network errors (#2853)

* Fixed disable button, formated time to include time zone

* Fixed bandit

* Fix hanging test
This commit is contained in:
Alex Janousek
2025-08-21 17:23:30 -04:00
committed by GitHub
parent 7cbd0602e6
commit b2f86e045f
5 changed files with 14 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ from bs4 import BeautifulSoup
from dotenv import load_dotenv
from flask import Flask, url_for
import app.utils.api_health
from app import create_app
from app.enums import AuthType, ServicePermission
from notifications_python_client.errors import HTTPError
@@ -35,6 +36,13 @@ from . import (
user_json,
)
# Mock is_api_down to prevent network calls during unit tests
# Set API_HOST_NAME to localhost to avoid network timeouts (sometimes they slow down in cicd)
os.environ["API_HOST_NAME"] = "http://localhost:6011"
# Also mock the function itself as a backup
app.utils.api_health.is_api_down = lambda: False
load_dotenv()