Commit 8a736d95 by Henrique Carvalho Alves Committed by Florian Apolloner

Fixed test runner for Django 1.4

parent c9c65c35
...@@ -32,6 +32,5 @@ setup( ...@@ -32,6 +32,5 @@ setup(
'Programming Language :: Python', 'Programming Language :: Python',
'Framework :: Django', 'Framework :: Django',
], ],
test_suite='taggit.tests.runtests.runtests' test_suite='taggit.tests.runtests.runtests',
) )
...@@ -6,7 +6,11 @@ from django.conf import settings ...@@ -6,7 +6,11 @@ from django.conf import settings
if not settings.configured: if not settings.configured:
settings.configure( settings.configure(
DATABASE_ENGINE='sqlite3', DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=[ INSTALLED_APPS=[
'django.contrib.contenttypes', 'django.contrib.contenttypes',
'taggit', 'taggit',
...@@ -14,21 +18,13 @@ if not settings.configured: ...@@ -14,21 +18,13 @@ if not settings.configured:
] ]
) )
from django.test.simple import run_tests
from django.test.simple import DjangoTestSuiteRunner
def runtests(*test_args): def runtests():
if not test_args: runner = DjangoTestSuiteRunner()
test_args = ['tests'] failures = runner.run_tests(['tests'], verbosity=1, interactive=True)
parent = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"..",
"..",
)
sys.path.insert(0, parent)
failures = run_tests(test_args, verbosity=1, interactive=True)
sys.exit(failures) sys.exit(failures)
if __name__ == '__main__': if __name__ == '__main__':
runtests(*sys.argv[1:]) runtests()
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 sign in to comment