ticketfrei3/backend/tests/tests_telegram/conftest.py

21 lines
534 B
Python

# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
# Copyright (C) 2020 by Martin Rey <martin.rey@mailbox.org>
#
# SPDX-License-Identifier: 0BSD
import pytest
from kibicara.model import Hood
from kibicara.platforms.telegram.model import Telegram
@pytest.fixture(scope="function")
@pytest.mark.anyio
async def telegram(hood_id, bot):
hood = await Hood.objects.get(id=hood_id)
return await Telegram.objects.create(
hood=hood,
api_token=bot["api_token"],
welcome_message=bot["welcome_message"],
)