Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • concrexit concrexit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 70
    • Issues 70
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 10
    • Merge requests 10
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • thaliathalia
  • concrexitconcrexit
  • Merge requests
  • !1186

Add automatic testing for model str method

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jelle Besseling requested to merge add-automatic-model-testing into master Mar 02, 2019
  • Overview 8
  • Commits 1
  • Changes 19

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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: add-automatic-model-testing