'If a request contains bad authentication credentials, then
authentication should run and error, even if no permissions
are set on the view.'

def test_incorrect_credentials(self):

    class IncorrectCredentialsAuth(BaseAuthentication, ):
        def authenticate(self, request):
            raise exceptions.AuthenticationFailed(u'Bad    credentials')
    request = factory.get(u'/')
    view = MockView.as_view(authentication_classes=(IncorrectCredentialsAuth,), permission_classes=())
    response = view(request)
    assert (response.status_code == status.HTTP_403_FORBIDDEN)
    assert (response.data == {u'detail': u'Bad    credentials'})
