Fixed #20048, #20060 -- Modified tests for contrib apps sensitive to custom User models.

Thanks to matiasb for the report of #20060 and the draft patch for #20048.