Skip to content

Add automatic testing for model str method

Jelle Besseling requested to merge add-automatic-model-testing into master

This adds dynamic tests which check if the overwritten str method of a Model is not the same as the default str method

If we want 100% coverage, the str methods should be tested. But usually, there is not really a good way to test them. This adds coverage to all the str methods automatically by testing that they contain "something useful" instead of having the default implementation.

In addition, it's good to have the str methods overridden because instance names will look weird in the admin without the user friendly name.

Merge request reports

Loading