mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-01-31 01:29:28 +01:00
ddc706e201
* fixed parsing bug * implemented events and publications endpoints split endpoints by entity removed credentials * add pagination (#179) * added pagination * integrated pagination with tortoise * added test for publications * removed converter file * updated dependencies
28 lines
595 B
Python
28 lines
595 B
Python
import pytest
|
|
import urllib3
|
|
from httpx import AsyncClient
|
|
|
|
from mobilizon_reshare.storage import db
|
|
from mobilizon_reshare.web.backend.main import app, init_endpoints
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def anyio_backend():
|
|
return "asyncio"
|
|
|
|
|
|
@pytest.fixture()
|
|
async def client():
|
|
init_endpoints(app)
|
|
|
|
async with AsyncClient(app=app, base_url="http://test") as client:
|
|
yield client
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def mock_sqlite_db(monkeypatch):
|
|
def get_url():
|
|
return urllib3.util.parse_url("sqlite://memory")
|
|
|
|
monkeypatch.setattr(db, "get_db_url", get_url)
|