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:
@@ -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()
|
||||
Reference in New Issue
Block a user