Fixed default LinkPreviewOptions JSON serialization (#1419)

* Fixed default link preview options serialization

* Added changelog
This commit is contained in:
Alex Root Junior 2024-02-17 10:10:50 +02:00 committed by GitHub
parent eef50a2edb
commit 53849b01a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 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):