#!/usr/bin/env python
import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

from django.test.utils import get_runner
from django.conf import settings

TestRunner = get_runner(settings)


def runtests():
    test_runner = TestRunner(verbosity=1, interactive=True)
    failures = test_runner.run_tests(['tests'])
    sys.exit(bool(failures))


if __name__ == '__main__':
    runtests()

@@ -168,17 +168,68 @@
 ettings%0A
-%0A
+import django%0A%0Adjango.setup()%0A%0A%0Adef runtests():%0A    
 TestRunn
@@ -254,34 +254,16 @@
 ttings)%0A
-%0A%0Adef runtests():%0A
     test

fix django 1.7 compatibility in test_runner