UEWBot / dipvis

Django-based visualiser for tournaments for the boardgame Diplomacy
GNU General Public License v3.0
7 stars 5 forks source link

Some tests misusing assertTrue for comparisons #215

Closed code-review-doctor closed 2 years ago

code-review-doctor commented 2 years ago

assertTrue is not for comparing arguments, should use assertEqual for that.

The developer's intent of the test was to compare argument 1 with argument 2, which is not happening. Really what is happening is the test is passing because first argument is truthy. The correct method to use is assertEqual. more details

https://github.com/UEWBot/dipvis/blob/7a9aadb2b3d8ff32cdbd59bebed3bd931656e767/visualiser/tournament/test_round_views.py#L412

I found this issue automatically, see other issues here