Make the models into dataclasses
With SQL alchemy 2.0, we can combine dataclasses with our models. This gives us a tighter rein on the __init__
methods, while providing us other special methods like __repr
(useful for debugging purposes) for "free".
To keep test changes as minimal as possible, helper functions were created just for tests to allow creating instances of the models without declaring every individual attribute.
user_crud changes were due to using an empty initializer before. User()
Edited by Mark Howard