diff --git a/aiogram/api/types/reply_keyboard_remove.py b/aiogram/api/types/reply_keyboard_remove.py index 52748c4a..ae092d94 100644 --- a/aiogram/api/types/reply_keyboard_remove.py +++ b/aiogram/api/types/reply_keyboard_remove.py @@ -15,7 +15,7 @@ class ReplyKeyboardRemove(MutableTelegramObject): Source: https://core.telegram.org/bots/api#replykeyboardremove """ - remove_keyboard: bool + remove_keyboard: bool = True """Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)""" diff --git a/tests/test_api/test_types/test_reply_keyboard_remove.py b/tests/test_api/test_types/test_reply_keyboard_remove.py new file mode 100644 index 00000000..12de28fb --- /dev/null +++ b/tests/test_api/test_types/test_reply_keyboard_remove.py @@ -0,0 +1,19 @@ +import pytest + +from aiogram.api.types import ReplyKeyboardRemove + + +class TestReplyKeyboardRemove: + """ + This test is needed to prevent to override value by code generator + """ + + def test_remove_keyboard_default_is_true(self): + assert ReplyKeyboardRemove.__fields__["remove_keyboard"].default is True + + @pytest.mark.parametrize( + "kwargs,expected", + [[{}, True], [{"remove_keyboard": True}, True], [{"remove_keyboard": False}, False]], + ) + def test_remove_keyboard_values(self, kwargs, expected): + assert ReplyKeyboardRemove(**kwargs).remove_keyboard is expected