def run_django_tests():
    try:
        import django
    except __HOLE__:
        print('Skipping django tests')
        return
    else:
        print('Running django integration tests')

    providers = 'micawber.contrib.mcdjango.mcdjango_tests.tests.test_pr'
    extensions = (
        ('oembed_no_urlize', {'urlize_all': False}),
    )

    from django.conf import settings
    if not settings.configured:
        settings.configure(
            DATABASES={
                'default': {
                    'ENGINE': 'django.db.backends.sqlite3',
                    },
                },
            SITE_ID=1,
            INSTALLED_APPS=[
                'django.contrib.auth',
                'django.contrib.contenttypes',
                'django.contrib.sessions',
                'django.contrib.sites',
                'micawber.contrib.mcdjango',
                'micawber.contrib.mcdjango.mcdjango_tests',
            ],
            MICAWBER_PROVIDERS=providers,
            MICAWBER_TEMPLATE_EXTENSIONS=extensions,
        )
    else:
        settings.MICAWBER_PROVIDERS = providers
        settings.MICAWBER_TEMPLATE_EXTENSIONS = extensions

    try:
        from django import setup
    except ImportError:
        pass
    else:
        setup()

    from django.test.runner import DiscoverRunner
    parent = os.path.dirname(os.path.abspath(__file__))
    sys.path.insert(0, parent)
    return DiscoverRunner().run_tests(['micawber/contrib/mcdjango'])
dataset/ETHPy150Open coleifer/micawber/runtests.py/run_django_tests