  
  
  class TestHyperlinkedRelatedField(UsingURLPatterns, APITestCase):
      included = [
          url(r'^namespaced/(?P<pk>\d+)/$', dummy_view, name='namespaced'),
      ]
  
      urlpatterns = [
          url(r'^v1/', include(included, namespace='v1')),
          url(r'^v2/', include(included, namespace='v2'))
 
</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

        url(r'^namespaced/(?P<pk>\d+)/$', dummy_pk_view, name='namespaced'),
  
  
  class TestHyperlinkedRelatedField(UsingURLPatterns, APITestCase):
      included = [
        url(r'^namespaced/(?P<pk>\d+)/$', dummy_pk_view, name='namespaced'),
      ]
  
      urlpatterns = [
          url(r'^v1/', include(included, namespace='v1')),
          url(r'^v2/', include(included, namespace='v2'))
keep keep keep keep replace keep keep keep keep keep
 Handle reversal of non-API view_name in HyperLinkedRelatedField 
tests/test_versioning.py