  
  router = SimpleRouter()
  router.register(r'resources', ResourceViewSet)
  urlpatterns = [
      url(r'^$', Root.as_view()),
      url(r'^resource/$', ResourceRoot.as_view()),
      url(r'^resource/customname$', CustomNameResourceInstance.as_view()),
      url(r'^resource/(?P<key>[0-9]+)$', ResourceInstance.as_view()),
      url(r'^resource/(?P<key>[0-9]+)/$', NestedResourceRoot.as_view()),
      url(r'^resource/(?P<key>[0-9]+)/(?P<other>[A-Za-z]+)$', NestedResourceInstance.as_view()),
  ]
  urlpatterns += router.urls
  
  
  @override_settings(ROOT_URLCONF='tests.test_utils')
 
</s> remove     url(r'^$', schema_view),
    url(r'^', include(router.urls))
 </s> add     path('', schema_view),
    path('', include(router.urls)) </s> remove     url(r'^$', FooView.as_view())
 </s> add     path('', FooView.as_view()) </s> remove     url(r'^$', MockView.as_view()),
 </s> add     path('', MockView.as_view()), </s> remove         url(r'^$', view),
 </s> add         path('', view), </s> remove     url(r'^$', MockView.as_view()),
    url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
 </s> add     path('', MockView.as_view()),
    path('auth/', include('rest_framework.urls', namespace='rest_framework')),
    path('', Root.as_view()),
    path('resource/', ResourceRoot.as_view()),
    path('resource/customname', CustomNameResourceInstance.as_view()),
    path('resource/<int:key>', ResourceInstance.as_view()),
    path('resource/<int:key>/', NestedResourceRoot.as_view()),
    path('resource/<int:key>/<str:other>', NestedResourceInstance.as_view()),
  
  router = SimpleRouter()
  router.register(r'resources', ResourceViewSet)
  urlpatterns = [
    path('', Root.as_view()),
    path('resource/', ResourceRoot.as_view()),
    path('resource/customname', CustomNameResourceInstance.as_view()),
    path('resource/<int:key>', ResourceInstance.as_view()),
    path('resource/<int:key>/', NestedResourceRoot.as_view()),
    path('resource/<int:key>/<str:other>', NestedResourceInstance.as_view()),
    path('', Root.as_view()),
    path('resource/', ResourceRoot.as_view()),
    path('resource/customname', CustomNameResourceInstance.as_view()),
    path('resource/<int:key>', ResourceInstance.as_view()),
    path('resource/<int:key>/', NestedResourceRoot.as_view()),
    path('resource/<int:key>/<str:other>', NestedResourceInstance.as_view()),
    path('', Root.as_view()),
    path('resource/', ResourceRoot.as_view()),
    path('resource/customname', CustomNameResourceInstance.as_view()),
    path('resource/<int:key>', ResourceInstance.as_view()),
    path('resource/<int:key>/', NestedResourceRoot.as_view()),
    path('resource/<int:key>/<str:other>', NestedResourceInstance.as_view()),
    path('', Root.as_view()),
    path('resource/', ResourceRoot.as_view()),
    path('resource/customname', CustomNameResourceInstance.as_view()),
    path('resource/<int:key>', ResourceInstance.as_view()),
    path('resource/<int:key>/', NestedResourceRoot.as_view()),
    path('resource/<int:key>/<str:other>', NestedResourceInstance.as_view()),
    path('', Root.as_view()),
    path('resource/', ResourceRoot.as_view()),
    path('resource/customname', CustomNameResourceInstance.as_view()),
    path('resource/<int:key>', ResourceInstance.as_view()),
    path('resource/<int:key>/', NestedResourceRoot.as_view()),
    path('resource/<int:key>/<str:other>', NestedResourceInstance.as_view()),
    path('', Root.as_view()),
    path('resource/', ResourceRoot.as_view()),
    path('resource/customname', CustomNameResourceInstance.as_view()),
    path('resource/<int:key>', ResourceInstance.as_view()),
    path('resource/<int:key>/', NestedResourceRoot.as_view()),
    path('resource/<int:key>/<str:other>', NestedResourceInstance.as_view()),
  ]
  urlpatterns += router.urls
  
  
  @override_settings(ROOT_URLCONF='tests.test_utils')
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Replace all url() calls with path() or re_path() (#7512)

* url() is deprecated in Django 3.1

* update given feedbacks on url() is deprecated in Django 3.1

* Fix test_urlpatterns.py to continue testing mixed re_path() and path()

* Fix one missed reference

Co-authored-by: sanjusci <sanju.sci9@gmail.com> 
tests/test_utils.py