brodriguez8774 / django-expanded-test-cases

Extends the existing Django TestCase class with extra functionality.
MIT License
2 stars 0 forks source link

Create Optional Settings to Force Warnings #15

Open brodriguez8774 opened 1 year ago

brodriguez8774 commented 1 year ago

It might be useful to create settings that enable/disable warnings on views. Defaults to off. These warnings would trigger when a given view test DOES NOT check a given thing.

A very obvious two values would be the page title (<title> tag) and page header (<h1> tag). Could have settings such as WARN_ON_MISSING_TITLE_CHECK and WARN_ON_MISSING_HEADER_CHECK that, if explicitly set to True, would then give a warning on every view where an associated check is not present.

Could be useful in instances, such as when the project originally didn't check for whatever attribute. But then partway through the project, they realize "okay, actually that's important, we really should be checking that everywhere". They could then enable the appropriate attribute check warning, and get notified of all the locations where the attribute is missing. More helpful for large projects with many tests.