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

Refs #23620.
test failure is cause this line was translated incorrectly: should be `IsNotNone`.
Please add the other assertion improvements to this commit as well when you have a chance. Thanks!