Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
concrexit
concrexit
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 70
    • Issues 70
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • thalia
  • concrexitconcrexit
  • Merge Requests
  • !1186

Merged
Opened Mar 02, 2019 by Jelle Besseling@jbesselingMaintainer

Add automatic testing for model str method

  • 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
Reviewer
Request review from
23
Milestone
23
Assign milestone
Time tracking
Reference: thalia/concrexit!1186
Source branch: add-automatic-model-testing