import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', "tests.settings")

from django.test.utils import setup_test_environment
setup_test_environment()

# Django 1.7
import django
if hasattr(django, 'setup'):
    django.setup()

from django.core.management import call_command
call_command('syncdb', interactive=False)

@@ -153,20 +153,56 @@
 ()%0A%0A
-# Django 1.7
+from django.core.management import call_command%0A
 %0Aimp
@@ -241,16 +241,34 @@
 etup'):%0A
+    # Django 1.7+%0A
     djan
@@ -282,57 +282,82 @@
 p()%0A
-%0Afrom django.core.management import call_command%0A
+    call_command('migrate', interactive=False)%0Aelse:%0A    # Django 1.6%0A    
 call

fix admin command