  
  from django.conf.urls import patterns, url
  from django.contrib.auth.models import User
  from rest_framework.authentication import TokenAuthentication
  from rest_framework.authtoken.models import Token
  from rest_framework.test import APITestCase
  from rest_framework.views import APIView
 
</s> remove from django.conf.urls import patterns, url
 </s> add from django.conf.urls import url </s> remove urlpatterns = patterns(
    '',
 </s> add urlpatterns = [ </s> remove from django.conf.urls import patterns, url, include
 </s> add from django.conf.urls import url, include </s> remove from django.conf.urls import patterns, url, include
 </s> add from django.conf.urls import url, include </s> remove from django.conf.urls import patterns, url
 </s> add from django.conf.urls import url
from django.conf.urls import url
  
from django.conf.urls import url
  from django.contrib.auth.models import User
  from rest_framework.authentication import TokenAuthentication
  from rest_framework.authtoken.models import Token
  from rest_framework.test import APITestCase
  from rest_framework.views import APIView
keep replace keep keep keep keep keep
 Remove `django.conf.urls.pattern` as it'll be removed in Django 2.0 
tests/test_middleware.py