<commit_before>import os
import sys
import unittest
import doctest
import django

BASE_PATH = os.path.dirname(__file__)

def main():
    """
    Standalone django model test with a 'memory-only-django-installation'.
    You can play with a django model without a complete django app installation.
    http://www.djangosnippets.org/snippets/1044/
    """
    os.environ["DJANGO_SETTINGS_MODULE"] = "django.conf.global_settings"
    from django.conf import global_settings

    global_settings.INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
    ) + (('south', ) if django.VERSION < 1.7 else ()) + (
        'boardinghouse',
        'django.contrib.admin',
    )
    global_settings.DATABASES = {
        'default': {
            'ENGINE': 'boardinghouse.backends.postgres',
            'NAME': os.environ['USER']
        }
    }
    global_settings.SOUTH_DATABASE_ADAPTERS = {
        'default': 'boardinghouse.backends.south_backend',
        'boardinghouse.backends.postgres': 'boardinghouse.backends.south_backend',
    }
    global_settings.ROOT_URLCONF = 'boardinghouse.tests.urls'
    
    global_settings.STATIC_URL = "/static/"
    global_settings.MEDIA_ROOT = os.path.join(BASE_PATH, 'static')
    global_settings.STATIC_ROOT = global_settings.MEDIA_ROOT<commit_msg>Much nicer method of putting south in INSTALLED_APPS.<commit_after>import os
import sys
import unittest
import doctest
import django

south = ()
try:
    if django.VERSION < (1,7):
        import south
        south = ('south',)
except ImportError:
    pass

BASE_PATH = os.path.dirname(__file__)

def main():
    """
    Standalone django model test with a 'memory-only-django-installation'.
    You can play with a django model without a complete django app installation.
    http://www.djangosnippets.org/snippets/1044/
    """
    os.environ["DJANGO_SETTINGS_MODULE"] = "django.conf.global_settings"
    from django.conf import global_settings

    global_settings.INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
    ) + south + (
        'boardinghouse',
        'django.contrib.admin',
    )
    global_settings.DATABASES = {
        'default': {
            'ENGINE': 'boardinghouse.backends.postgres',
            'NAME': os.environ['USER']
        }
    }
    global_settings.SOUTH_DATABASE_ADAPTERS = {
        'default': 'boardinghouse.backends.south_backend',
        'boardinghouse.backends.postgres': 'boardinghouse.backends.south_backend',
    }
    global_settings.ROOT_URLCONF = 'boardinghouse.tests.urls'
    
    global_settings.STATIC_URL = "/static/"
    global_settings.MEDIA_ROOT = os.path.join(BASE_PATH, 'static')
    global_settings.STATIC_ROOT = global_settings.MEDIA_ROOT
{'fraction_non_alphanumeric': 0.11327433628318584, 'fraction_numerical': 0.004247787610619469, 'mean_word_length': 3.0956521739130434, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2688208', 'n_tokens_mistral': 903, 'n_tokens_neox': 870, 'n_words': 158}