aiogram/tests
Alex Root Junior 74e00a30b1
"Add get_mounted_bot function and improve model comparison in tests"
In this commit, a new function `get_mounted_bot` was added to `context_controller.py` that returns the bot mounted in context. This function was needed to bypass the limitation in pydantic BaseModel's properties, which neither support computed fields nor serialization/validation.

Various tests were also updated to compare models using `model_dump_json()` method rather than comparing the models directly. This change provides more accurate comparisons by considering default values in the models.

Further, the dispatcher was adjusted to enforce update re-mounting if the mounted bot differs from the current update. This allows shortcuts to be used in the bot's current instance and ensures the correct propagation of the context to all the nested objects and attributes of Updates.
2023-07-16 22:46:45 +03:00
..
data/locales Dev 3.x i18n & improvements (#696) 2021-09-22 00:52:38 +03:00
test_api Fixed subtypes and union types generation, new enums added (#1213) 2023-07-11 23:39:54 +03:00
test_dispatcher "Add get_mounted_bot function and improve model comparison in tests" 2023-07-16 22:46:45 +03:00
test_filters Fixed subtypes and union types generation, new enums added (#1213) 2023-07-11 23:39:54 +03:00
test_flags Dev 3.x flat package (#961) 2022-08-14 01:07:52 +03:00
test_fsm #1186 Renamed USER_IN_THREAD to USER_IN_TOPIC 2023-07-01 21:53:34 +03:00
test_handler Added full support of Bot API 6.4 (#1088) 2022-12-30 22:44:25 +02:00
test_utils Formatting tools (#1172) 2023-06-10 20:47:45 +03:00
test_webhook parameter secret_token (#1173) 2023-06-25 00:40:04 +03:00
__init__.py Update tests and small refactoring 2019-11-16 22:32:26 +02:00
conftest.py Migrate to hatchling (#1095) 2023-01-12 02:49:58 +02:00
deprecated.py Upgrade architecture + 5.0 Bot API (#469) 2021-01-26 21:20:52 +02:00
docker-compose.yml Backport and improvements (#601) 2021-06-15 01:45:31 +03:00
mocked_bot.py "Add get_mounted_bot function and improve model comparison in tests" 2023-07-16 22:46:45 +03:00