[generic-auth] Added an extensible function for filtering querysets based on permission into the tests. This should be moved out into the actual codebase at some point. Note that it's far from complete.