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

import django

from django.conf import settings


DEFAULT_SETTINGS = dict(
    INSTALLED_APPS=[
        "django.contrib.auth",
        "django.contrib.contenttypes",
        "django.contrib.sites",
        "account",
        "pinax.ratings",
        "pinax.ratings.tests"
    ],
    DATABASES={
        "default": {
            "ENGINE": "django.db.backends.sqlite3",
            "NAME": ":memory:",
        }
    },
    SITE_ID=1,
    ROOT_URLCONF="pinax.ratings.tests.urls",
    SECRET_KEY="notasecret",
)


def runtests(*test_args):
    if not settings.configured:
        settings.configure(**DEFAULT_SETTINGS)

    django.setup()

    parent = os.path.dirname(os.path.abspath(__file__))
    sys.path.insert(0, parent)

    try:
        from django.test.runner import DiscoverRunner
        runner_class = DiscoverRunner
        test_args = ["pinax.ratings.tests"]
    except ImportError:
        from django.test.simple import DjangoTestSuiteRunner
        runner_class = DjangoTestSuiteRunner
        test_args = ["tests"]

    failures = runner_class(verbosity=1, interactive=True, failfast=False).run_tests(test_args)
    sys.exit(failures)


if __name__ == "__main__":
    runtests(*sys.argv[1:])

@@ -231,24 +231,59 @@
 rib.sites%22,%0A
+        %22django.contrib.sessions%22,%0A
         %22acc
@@ -359,122 +359,751 @@
     
-DATABASES=%7B%0A        %22default%22: %7B%0A            %22ENGINE%22: %22django.db.backends.sqlite3%22,%0A            %22NAME%22: %22:memory:
+MIDDLEWARE=%5B%0A        %22django.contrib.sessions.middleware.SessionMiddleware%22,%0A        %22django.contrib.auth.middleware.AuthenticationMiddleware%22%0A    %5D,%0A    TEMPLATES=%5B%0A        %7B%0A            %22BACKEND%22: %22django.template.backends.django.DjangoTemplates%22,%0A            %22APP_DIRS%22: True,%0A            %22OPTIONS%22: %7B%0A                %22debug%22: True,%0A                %22context_processors%22: %5B%0A                    %22django.contrib.auth.context_processors.auth%22,%0A                %5D%0A            %7D%0A        %7D,%0A    %5D,%0A    DATABASES=%7B%0A        %22default%22: %7B%0A            %22ENGINE%22: %22django.db.backends.sqlite3%22,%0A            %22NAME%22: %22:memory:%22,%0A        %7D%0A    %7D,%0A    PINAX_RATINGS_CATEGORY_CHOICES = %7B%0A        %22tests.Car%22: %7B%0A            %22handling%22: %22How good is the handling?
 %22,%0A 

update runtests