diff --git a/tests/contrib/django/middleware.py b/tests/contrib/django/middleware.py
index <HASH>..<HASH> 100644
--- a/tests/contrib/django/middleware.py
+++ b/tests/contrib/django/middleware.py
@@ -1,13 +1,22 @@
-class BrokenRequestMiddleware(object):
+try:
+    # Django >= 1.10
+    from django.utils.deprecation import MiddlewareMixin
+except ImportError:
+    # Not required for Django <= 1.9, see:
+    # https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware
+    MiddlewareMixin = object
+
+
+class BrokenRequestMiddleware(MiddlewareMixin):
     def process_request(self, request):
         raise ImportError('request')
 
 
-class BrokenResponseMiddleware(object):
+class BrokenResponseMiddleware(MiddlewareMixin):
     def process_response(self, request, response):
         raise ImportError('response')
 
 
-class BrokenViewMiddleware(object):
+class BrokenViewMiddleware(MiddlewareMixin):
     def process_view(self, request, func, args, kwargs):
         raise ImportError('view')
Add `MiddlewareMixin` for these test classes as well