  from rest_framework.test import APIRequestFactory, APITestCase
  from rest_framework.versioning import NamespaceVersioning
  import pytest
  
  
  class RequestVersionView(APIView):
      def get(self, request, *args, **kwargs):
          return Response({'version': request.version})
 
</s> remove         url(r'^namespaced/(?P<pk>\d+)/$', dummy_view, name='namespaced'),
 </s> add         url(r'^namespaced/(?P<pk>\d+)/$', dummy_pk_view, name='namespaced'), </s> remove             viewname = self.get_versioned_viewname(viewname, request)
 </s> add             versioned_viewname = self.get_versioned_viewname(viewname, request)
            try:
                return super(NamespaceVersioning, self).reverse(
                    versioned_viewname, args, kwargs, request, format, **extra
                )
            except NoReverseMatch:
                # If the versioned viewname lookup fails, fallback to the
                # default reversal, since it may be a non-API view
                pass

from rest_framework.relations import PKOnlyObject
  from rest_framework.test import APIRequestFactory, APITestCase
  from rest_framework.versioning import NamespaceVersioning
from rest_framework.relations import PKOnlyObject
  import pytest
  
  
  class RequestVersionView(APIView):
      def get(self, request, *args, **kwargs):
          return Response({'version': request.version})
keep add keep keep keep keep keep keep
 Handle reversal of non-API view_name in HyperLinkedRelatedField 
tests/test_versioning.py