  @override_settings(REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema'})
  class SchemaGenerationExclusionTests(TestCase):
      def setUp(self):
          self.patterns = [
              url('^excluded-cbv/$', ExcludedAPIView.as_view()),
              url('^excluded-fbv/$', excluded_fbv),
              url('^included-fbv/$', included_fbv),
          ]
  
      def test_schema_generator_excludes_correctly(self):
          """Schema should not include excluded views"""
          generator = SchemaGenerator(title='Exclusions', patterns=self.patterns)
 
</s> remove             url(r'^example/?$', ForeignKeySourceView.as_view()),
 </s> add             path('example/', ForeignKeySourceView.as_view()), </s> remove             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()),
 </s> add             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()), </s> remove             url(r'^example/?$', ManyToManySourceView.as_view()),
 </s> add             path('example/', ManyToManySourceView.as_view()), </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/?$', ExampleView.as_view()),
 </s> add             path('example/', ExampleView.as_view()),
            path('excluded-cbv/', ExcludedAPIView.as_view()),
            path('excluded-fbv/', excluded_fbv),
            path('included-fbv/', included_fbv),
  @override_settings(REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema'})
  class SchemaGenerationExclusionTests(TestCase):
      def setUp(self):
          self.patterns = [
            path('excluded-cbv/', ExcludedAPIView.as_view()),
            path('excluded-fbv/', excluded_fbv),
            path('included-fbv/', included_fbv),
            path('excluded-cbv/', ExcludedAPIView.as_view()),
            path('excluded-fbv/', excluded_fbv),
            path('included-fbv/', included_fbv),
            path('excluded-cbv/', ExcludedAPIView.as_view()),
            path('excluded-fbv/', excluded_fbv),
            path('included-fbv/', included_fbv),
          ]
  
      def test_schema_generator_excludes_correctly(self):
          """Schema should not include excluded views"""
          generator = SchemaGenerator(title='Exclusions', patterns=self.patterns)
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