#!/usr/bin/env python
import sys

from django.conf import settings

def configure():

    from faker import Faker

    fake = Faker()

    settings.configure(
        DATABASES={
            'default': {
                'ENGINE': 'django.db.backends.sqlite3',
                'NAME': ':memory:',
                }
        },
        INSTALLED_APPS=(
            'django_faker',
            ),
        SITE_ID=1,
        SECRET_KEY=fake.sha1(),
    )

if not settings.configured: configure()


from django.test.utils import get_runner


def runtests():
    TestRunner = get_runner(settings)
    test_runner = TestRunner(verbosity=1, interactive=True, failfast=False)
    failures = test_runner.run_tests(['django_faker', ])
    sys.exit(failures)


if __name__ == '__main__':
    runtests()



@@ -26,16 +26,29 @@
 ort sys%0A
+import django
 %0Afrom dj
@@ -73,16 +73,58 @@
 ettings%0A
+from django.test.utils import get_runner%0A%0A
 %0Adef con
@@ -133,17 +133,16 @@
 gure():%0A
-%0A
     from
@@ -161,17 +161,16 @@
 t Faker%0A
-%0A
     fake
@@ -416,21 +416,20 @@
 'django_
-faker
+seed
 ',%0A     
@@ -496,16 +496,17 @@
 %0A    )%0A%0A
+%0A
 if not s
@@ -525,16 +525,21 @@
 igured: 
+%0A    
 configur
@@ -548,66 +548,42 @@
 )%0A%0A%0A
-from django.test.utils import get_runner%0A%0A%0Adef runtests
+def runtests():%0A    django.setup
 ()
-:
 %0A   
@@ -739,21 +739,20 @@
 'django_
-faker
+seed
 ', %5D)%0A  

fix test runner