  @override_settings(REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema'})
  class TestSchemaGeneratorNotAtRoot(TestCase):
      def setUp(self):
          self.patterns = [
              url(r'^api/v1/example/?$', views.ExampleListView.as_view()),
              url(r'^api/v1/example/(?P<pk>\d+)/?$', views.ExampleDetailView.as_view()),
              url(r'^api/v1/example/(?P<pk>\d+)/sub/?$', views.ExampleDetailView.as_view()),
          ]
  
      def test_schema_for_regular_views(self):
          """
          Ensure that schema generation with an API that is not at the URL
 
</s> remove             url(r'^example/?$', views.ExampleListView.as_view()),
            url(r'^example/(?P<pk>\d+)/?$', views.ExampleDetailView.as_view()),
            url(r'^example/(?P<pk>\d+)/sub/?$', views.ExampleDetailView.as_view()),
 </s> add             path('example/', views.ExampleListView.as_view()),
            path('example/<int:pk>/', views.ExampleDetailView.as_view()),
            path('example/<int:pk>/sub/', views.ExampleDetailView.as_view()), </s> remove             url(r'^example/?$', ForeignKeySourceView.as_view()),
 </s> add             path('example/', ForeignKeySourceView.as_view()), </s> remove             url(r'^example/?$', ManyToManySourceView.as_view()),
 </s> add             path('example/', ManyToManySourceView.as_view()), </s> remove             url(r'^', include(router.urls))
 </s> add             path('', include(router.urls)) </s> remove             url('^example/?$', views.ExampleListView.as_view()),
            url(r'^', include(router.urls))
 </s> add             path('example/', views.ExampleListView.as_view()),
            path('', include(router.urls))
            path('api/v1/example/', views.ExampleListView.as_view()),
            path('api/v1/example/<int:pk>/', views.ExampleDetailView.as_view()),
            path('api/v1/example/<int:pk>/sub/', views.ExampleDetailView.as_view()),
  @override_settings(REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema'})
  class TestSchemaGeneratorNotAtRoot(TestCase):
      def setUp(self):
          self.patterns = [
            path('api/v1/example/', views.ExampleListView.as_view()),
            path('api/v1/example/<int:pk>/', views.ExampleDetailView.as_view()),
            path('api/v1/example/<int:pk>/sub/', views.ExampleDetailView.as_view()),
            path('api/v1/example/', views.ExampleListView.as_view()),
            path('api/v1/example/<int:pk>/', views.ExampleDetailView.as_view()),
            path('api/v1/example/<int:pk>/sub/', views.ExampleDetailView.as_view()),
            path('api/v1/example/', views.ExampleListView.as_view()),
            path('api/v1/example/<int:pk>/', views.ExampleDetailView.as_view()),
            path('api/v1/example/<int:pk>/sub/', views.ExampleDetailView.as_view()),
          ]
  
      def test_schema_for_regular_views(self):
          """
          Ensure that schema generation with an API that is not at the URL
keep keep keep keep 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/schemas/test_coreapi.py