<commit_before>#!/usr/bin/env python
import os, sys
from django.conf import settings

settings.configure(
    DEBUG=True,
    DATABASES={
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
        }
    },
    ROOT_URLCONF='urls',
    INSTALLED_APPS=(
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.admin',
        'arcutils',
    ),
    LDAP={
        "default": {
            "host": "ldap://ldap-login.oit.pdx.edu",
            "username": "",
            "password": "",
            "search_dn": "ou=people,dc=pdx,dc=edu",
        }
    }
)


from django.test.simple import DjangoTestSuiteRunner
test_runner = DjangoTestSuiteRunner(verbosity=1)
failures = test_runner.run_tests(['arcutils', ])
if failures:
    sys.exit(failures)<commit_msg>Make runtests.py Django 1.7 compatible<commit_after>#!/usr/bin/env python
import sys

import django
from django.conf import settings

settings.configure(
    DEBUG=True,
    DATABASES={
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
        }
    },
    ROOT_URLCONF='urls',
    INSTALLED_APPS=(
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.admin',
        'arcutils',
    ),
    MIDDLEWARE_CLASSES=[],
    LDAP={
        "default": {
            "host": "ldap://ldap-login.oit.pdx.edu",
            "username": "",
            "password": "",
            "search_dn": "ou=people,dc=pdx,dc=edu",
        }
    }
)

if django.VERSION[:2] >= (1, 7):
    from django import setup
else:
    setup = lambda: None

from django.test.simple import DjangoTestSuiteRunner
from django.test.utils import setup_test_environment

setup()
setup_test_environment()
test_runner = DjangoTestSuiteRunner(verbosity=1)
failures = test_runner.run_tests(['arcutils', ])
if failures:
    sys.exit(failures)
{'fraction_non_alphanumeric': 0.1432251416795466, 'fraction_numerical': 0.00463678516228748, 'mean_word_length': 2.5567765567765566, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1139511', 'n_tokens_mistral': 647, 'n_tokens_neox': 625, 'n_words': 105}