Source types, connection test, server folders, uploads and OAuth sign-in for the Conectar dialog; sign-in for the web app with fastapi-users, the API left open

This commit is contained in:
Roberto Treviño
2026-11-28 09:29:59 -06:00
parent d3f7aeb537
commit b515746406
10 changed files with 749 additions and 26 deletions
+20
View File
@@ -0,0 +1,20 @@
"""In-process API tests: a platform of their own (never the deployed data folder)."""
import pytest
from webapi import sources, users
@pytest.fixture
def own_platform(tmp_path, monkeypatch):
"""The API's data folder, platform database and sign-in in tmp_path."""
monkeypatch.setenv("ISSSTELEON_DATA", str(tmp_path))
monkeypatch.setattr(sources, "DATA_DIR", tmp_path)
monkeypatch.setattr(users, "DATA_DIR", tmp_path)
monkeypatch.setenv("PLATFORM_DATABASE_URL", f"sqlite:///{tmp_path / 'platform.db'}")
monkeypatch.delenv("AUTH_SECRET", raising=False)
users._engine.cache_clear()
users._secret.cache_clear()
yield tmp_path
users._engine.cache_clear()
users._secret.cache_clear()