Giacomo Leidi 529f83825e
Pave the way for using only EventPublications outside of storage module. (#149)
* Move `EventPublication.from_orm` to `storage.query.converter`.

Co-authored-by: Simone Robutti <simone.robutti@protonmail.com>
2022-02-23 17:26:13 +01:00

18 lines
471 B
Python

from uuid import UUID
import pytest
from mobilizon_reshare.storage.query.converter import event_to_model
from mobilizon_reshare.storage.query.read import get_all_events
@pytest.mark.asyncio
async def test_get_all_events(event_generator):
all_events = [
event_generator(mobilizon_id=UUID(int=i), published=False) for i in range(4)
]
for e in all_events:
await event_to_model(e).save()
assert list(await get_all_events()) == all_events