diff --git a/tests/testing.py b/tests/testing.py
index <HASH>..<HASH> 100644
--- a/tests/testing.py
+++ b/tests/testing.py
@@ -13,10 +13,20 @@ def setup_django():
                 'django.contrib.auth',
                 'django.contrib.contenttypes',
                 'django_ftpserver',
-            )
+            ),
+            MIDDLEWARE_CLASSES=(),
         )
-    from django.db.models.loading import cache as model_cache
-    if not model_cache.loaded:
-        model_cache._populate()
-        from django.core.management import call_command
-        call_command('syncdb', interactive=False)
+    from django import VERSION as version
+    # In Django 1.7 or later, using "django.apps" module.
+    if version[0] == 1 and version[1] >= 7:
+        from django.apps import apps
+        if not apps.ready:
+            apps.populate(settings.INSTALLED_APPS)
+            from django.core.management import call_command
+            call_command('syncdb', interactive=False)
+    else:
+        from django.db.models.loading import cache as model_cache
+        if not model_cache.loaded:
+            model_cache._populate()
+            from django.core.management import call_command
+            call_command('syncdb', interactive=False)
modify testing utility for Django <I>