Fixed default link preview options serialization

This commit is contained in:
JRoot Junior 2024-02-17 10:00:34 +02:00
parent eef50a2edb
commit f7eb392d03
No known key found for this signature in database
GPG key ID: 738964250D5FF6E2
2 changed files with 13 additions and 3 deletions

View file

@ -26,7 +26,7 @@ from aiogram.exceptions import (
TelegramUnauthorizedError,
)
from aiogram.methods import DeleteMessage, GetMe, TelegramMethod
from aiogram.types import UNSET_PARSE_MODE, User
from aiogram.types import UNSET_PARSE_MODE, User, LinkPreviewOptions
from aiogram.types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT
from tests.mocked_bot import MockedBot
@ -111,6 +111,10 @@ class TestBaseSession:
),
"1494994302",
],
[
{"link_preview": LinkPreviewOptions(is_disabled=True)},
'{"link_preview": {"is_disabled": true}}',
],
],
)
def test_prepare_value(self, value: Any, result: str, bot: MockedBot):