import pytest from pydantic import ValidationError from app.core.config import BACKEND_ROOT, Settings def test_settings_load_environment_from_backend_directory() -> None: assert Settings.model_config["env_file"] == BACKEND_ROOT / ".env" @pytest.mark.parametrize( ("field", "value"), [ ("mysql_core_database", "insurance_core"), ("mysql_agent_database", "insurance_agent"), ("mysql_analytics_database", "insurance_analytics"), ("redis_prefix", "ins:"), ], ) def test_stage_one_configuration_rejects_unsafe_data_targets( field: str, value: str, ) -> None: with pytest.raises(ValidationError): Settings( app_env="test", jwt_access_secret="a" * 32, jwt_refresh_secret="b" * 32, field_encryption_key="c" * 32, **{field: value}, )