Used more specific asserts than assertTrue in the Django test suite.

Refs #23620.
I've updated the PR. There are still more than 200 assertions needs to be updated. I will leave them to another PR to make code review easier.