Commit 98aa77fb authored by Jannis Leidel's avatar Jannis Leidel Committed by Sean Bleier

Added convenient runtest.py, thanks Carl Meyer and Alex Gaynor.

parent c6162bc5
#!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE='sqlite3',
INSTALLED_APPS=[
'tests.testapp',
]
)
from django.test.simple import run_tests
def runtests(*test_args):
if not test_args:
test_args = ['testapp']
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
failures = run_tests(test_args, verbosity=1, interactive=True)
sys.exit(failures)
if __name__ == '__main__':
runtests(*sys.argv[1:])
\ No newline at end of file
DEBUG = True
ROOT_URLCONF = 'urls'
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'redis_cache.db'
INSTALLED_APPS = [
'testapp',
'tests.testapp',
]
......@@ -4,7 +4,7 @@ import time
import unittest
from django.core.cache import get_cache
from testapp.models import Poll, expensive_calculation
from models import Poll, expensive_calculation
# functions/classes for complex data type tests
def f():
......@@ -16,7 +16,7 @@ class C:
class RedisCacheTests(unittest.TestCase):
"""
A common set of tests derived from Django's own cache tests
"""
def setUp(self):
# use DB 16 for testing and hope there isn't any important data :->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment