From 8a77939d5bf7778be8a65e3531781220245724ff Mon Sep 17 00:00:00 2001 From: Oleg A Date: Tue, 19 Sep 2023 17:44:39 +0300 Subject: [PATCH] Update deprecated pydantic fields access (#1309) * chore: update deprecated pydantic fields access * chore: add type hints for test * fix: 3.9- type support --- tests/test_api/test_types/test_reply_keyboard_remove.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_api/test_types/test_reply_keyboard_remove.py b/tests/test_api/test_types/test_reply_keyboard_remove.py index 984932a5..1d252cc5 100644 --- a/tests/test_api/test_types/test_reply_keyboard_remove.py +++ b/tests/test_api/test_types/test_reply_keyboard_remove.py @@ -1,3 +1,5 @@ +from typing import Dict + import pytest from aiogram.types import ReplyKeyboardRemove @@ -10,12 +12,12 @@ class TestReplyKeyboardRemove: def test_remove_keyboard_default_is_true(self): assert ( - ReplyKeyboardRemove.__fields__["remove_keyboard"].default is True + ReplyKeyboardRemove.model_fields["remove_keyboard"].default is True ), "Remove keyboard has incorrect default value!" @pytest.mark.parametrize( "kwargs,expected", [[{}, True], [{"remove_keyboard": True}, True]], ) - def test_remove_keyboard_values(self, kwargs, expected): + def test_remove_keyboard_values(self, kwargs: Dict[str, bool], expected: bool): assert ReplyKeyboardRemove(**kwargs).remove_keyboard is expected