  
  
  class MockView(APIView):
      permission_classes = (permissions.IsAuthenticated,)
  
      def get(self, request):
          return HttpResponse({'a': 1, 'b': 2, 'c': 3})
 
</s> remove from rest_framework.authentication import TokenAuthentication, BasicAuthentication, SessionAuthentication
 </s> add from rest_framework.authentication import (
    BaseAuthentication,
    TokenAuthentication,
    BasicAuthentication,
    SessionAuthentication
)
factory = RequestFactory()


  
  
factory = RequestFactory()


  class MockView(APIView):
      permission_classes = (permissions.IsAuthenticated,)
  
      def get(self, request):
          return HttpResponse({'a': 1, 'b': 2, 'c': 3})
keep add keep keep keep keep keep
 Auth is no longer lazy.  Closes #667.

More consistent auth failure behavior. 
rest_framework/tests/authentication.py