2020-07-19 12:13:15 +00:00
|
|
|
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
|
2020-09-28 22:54:34 +00:00
|
|
|
# Copyright (C) 2020 by Martin Rey <martin.rey@mailbox.org>
|
2020-07-19 12:13:15 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: 0BSD
|
|
|
|
|
2020-10-13 08:35:20 +00:00
|
|
|
from pytest import fixture
|
|
|
|
|
2020-07-19 12:13:15 +00:00
|
|
|
from kibicara.model import Hood
|
|
|
|
from kibicara.platforms.telegram.model import Telegram
|
|
|
|
|
|
|
|
|
2023-03-18 17:47:02 +00:00
|
|
|
@fixture(scope="function")
|
2020-07-19 12:13:15 +00:00
|
|
|
def telegram(event_loop, hood_id, bot):
|
|
|
|
hood = event_loop.run_until_complete(Hood.objects.get(id=hood_id))
|
|
|
|
return event_loop.run_until_complete(
|
|
|
|
Telegram.objects.create(
|
|
|
|
hood=hood,
|
2023-03-18 17:47:02 +00:00
|
|
|
api_token=bot["api_token"],
|
|
|
|
welcome_message=bot["welcome_message"],
|
2020-07-19 12:13:15 +00:00
|
|
|
)
|
|
|
|
)
|