  from django.test import TestCase
  
  from rest_framework import (
      HTTP_HEADER_ENCODING, authentication, generics, permissions, serializers,
      status
  )
  from rest_framework.compat import ResolverMatch, guardian, set_many
  from rest_framework.filters import DjangoObjectPermissionsFilter
  from rest_framework.routers import DefaultRouter
  from rest_framework.test import APIRequestFactory
 
</s> remove         if hasattr(view, 'get_queryset'):
            queryset = view.get_queryset()
            assert queryset is not None, (
                '{}.get_queryset() returned None'.format(view.__class__.__name__)
            )
        else:
            queryset = getattr(view, 'queryset', None)

        assert queryset is not None, (
            'Cannot apply DjangoModelPermissions on a view that '
            'does not set `.queryset` or have a `.get_queryset()` method.'
        )

 </s> add         queryset = self._queryset(view) </s> remove         if hasattr(view, 'get_queryset'):
            queryset = view.get_queryset()
        else:
            queryset = getattr(view, 'queryset', None)

        assert queryset is not None, (
            'Cannot apply DjangoObjectPermissions on a view that '
            'does not set `.queryset` or have a `.get_queryset()` method.'
        )

 </s> add         # authentication checks have already executed via has_permission
        queryset = self._queryset(view)
    status, views
  from django.test import TestCase
  
  from rest_framework import (
      HTTP_HEADER_ENCODING, authentication, generics, permissions, serializers,
    status, views
  )
  from rest_framework.compat import ResolverMatch, guardian, set_many
  from rest_framework.filters import DjangoObjectPermissionsFilter
  from rest_framework.routers import DefaultRouter
  from rest_framework.test import APIRequestFactory
keep keep keep keep replace keep keep keep keep keep
 Unify QS handling for model/object permissions 
tests/test_permissions.py