aiogram/aiogram/dispatcher
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
..
event skip if current router does not have observer for custom event (#1147) 2023-04-08 17:39:48 +03:00
middlewares Update pydantic to V2 (#1202) 2023-07-02 15:07:19 +03:00
__init__.py Add Router 2019-11-23 19:54:04 +02:00
dispatcher.py "Add get_mounted_bot function and improve model comparison in tests" 2023-07-16 22:46:45 +03:00
flags.py Reworked graceful shutdown (#1124) 2023-02-18 15:46:28 +02:00
router.py skip if current router does not have observer for custom event (#1147) 2023-04-08 17:39:48 +03:00