level12 / keg-elements

Other
1 stars 4 forks source link

Column tests should catch instantiated date defaults #149

Closed matthiaswh closed 3 years ago

matthiaswh commented 3 years ago

It's easy to accidentally add a date / time column with an instantiated default rather than a callable. Not that I have ever personally done this before :eyes:

foo_date = sa.Column(sa.Date, default=datetime.date.today(), nullable=False)

Normal tests won't typically catch this, since they're run immediately after the app is initialized. It's also difficult to see in a manual QA test since the default is usually now() or today(). It's only after the application has been running for awhile that these bugs become visible, and even then, they're not always apparent.

KE should catch these in its column checks.