M1-T05: drop location/poo database config from Settings and tests

Remove the dead location_database_url / poo_database_url fields and the
location_sqlite_path / poo_sqlite_path computed properties from Settings;
drop them from the config-page payload and from .env.example. Update the
test hardcodes (test_config, test_public_ip, test_smtp) and reduce the
conftest test_database_urls fixture to the single app DB. The one-time
migration script keeps reading legacy URLs from env/CLI, independent of
Settings.

pytest 95 passed; ruff clean (pre-existing only).
This commit is contained in:
2026-06-12 16:57:54 +02:00
parent 0d898e09f2
commit af8c602988
7 changed files with 1 additions and 40 deletions
+1 -9
View File
@@ -1,10 +1,8 @@
from app.config import Settings
def test_settings_support_two_independent_database_urls(monkeypatch) -> None:
def test_settings_load_core_fields_from_env(monkeypatch) -> None:
monkeypatch.setenv("APP_DATABASE_URL", "sqlite:///./data/app.db")
monkeypatch.setenv("LOCATION_DATABASE_URL", "sqlite:///./data/locationRecorder.db")
monkeypatch.setenv("POO_DATABASE_URL", "sqlite:///./data/pooRecorder.db")
monkeypatch.setenv("APP_HOSTNAME", "home.example.com")
monkeypatch.setenv("POO_WEBHOOK_ID", "poo-hook")
monkeypatch.setenv("POO_SENSOR_ENTITY_NAME", "sensor.test_poo_status")
@@ -21,8 +19,6 @@ def test_settings_support_two_independent_database_urls(monkeypatch) -> None:
settings = Settings(_env_file=None)
assert settings.app_database_url == "sqlite:///./data/app.db"
assert settings.location_database_url == "sqlite:///./data/locationRecorder.db"
assert settings.poo_database_url == "sqlite:///./data/pooRecorder.db"
assert settings.poo_webhook_id == "poo-hook"
assert settings.poo_sensor_entity_name == "sensor.test_poo_status"
assert settings.poo_sensor_friendly_name == "Poo Status"
@@ -36,12 +32,8 @@ def test_settings_support_two_independent_database_urls(monkeypatch) -> None:
assert settings.auth_bootstrap_password == "secret"
assert settings.auth_session_cookie_name == "auth_cookie"
assert settings.auth_session_ttl_hours == 8
assert settings.location_sqlite_path is not None
assert settings.location_sqlite_path.name == "locationRecorder.db"
assert settings.app_sqlite_path is not None
assert settings.app_sqlite_path.name == "app.db"
assert settings.poo_sqlite_path is not None
assert settings.poo_sqlite_path.name == "pooRecorder.db"
assert settings.auth_cookie_secure is True