  from rest_framework.test import APITestCase
  from rest_framework.views import APIView
  
  
  urlpatterns = patterns(
      '',
      url(r'^$', APIView.as_view(authentication_classes=(TokenAuthentication,))),
  )
  
  
  class MyMiddleware(object):
 
</s> remove from django.conf.urls import patterns, url
 </s> add from django.conf.urls import url </s> remove )
 </s> add ] </s> remove from django.conf.urls import patterns, url, include
 </s> add from django.conf.urls import url, include </s> remove urlpatterns = patterns(
    '',
 </s> add urlpatterns = [ </s> remove from django.conf.urls import patterns
 </s> add 
urlpatterns = [
  from rest_framework.test import APITestCase
  from rest_framework.views import APIView
  
  
urlpatterns = [
urlpatterns = [
      url(r'^$', APIView.as_view(authentication_classes=(TokenAuthentication,))),
  )
  
  
  class MyMiddleware(object):
keep keep keep keep replace replace keep keep keep keep keep
 Remove `django.conf.urls.pattern` as it'll be removed in Django 2.0 
tests/test_middleware.py