Don’t raise AuthenticationFailed if user didn’t try to authenticate.

Besides this fix, I’ve added some tests for Rest Framework authentication support. They don’t cover 100% of the code they attempt to test, so they are either incomplete or some code can be removed (or both).