[4.2] Tests : assertSame and assertNotSame

Use assertSame and assertNotSame instead of boolean assertions

This PR comes with other PR: #5333 #5334 #5336 #5337 
They are split for review and readability purpose.
@taylorotwell , let me know if you prefer a global PR with all the changes instead of separate PR