Skip to content
Browse files

Fixed test file name

  • Loading branch information...
1 parent 6dc9e1a commit 7a72eb80231c71150baea297abc9ac54190aa8c1 @palewire palewire committed Jun 14, 2012
Showing with 22 additions and 4 deletions.
  1. +1 −1 .travis.yml
  2. +21 −3 qiktest.py
View
2 .travis.yml
@@ -12,4 +12,4 @@ install:
- pip install -r requirements.txt --use-mirrors
- pip install -q Django==$DJANGO_VERSION --use-mirrors
# command to run tests
-script: python run_tests.py yamlfield
+script: python qiktest.py yamlfield
View
24 qiktest.py
@@ -21,36 +21,46 @@ class QikDjangoTest(object):
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
- 'yamlfield',
)
def __init__(self, *args, **kwargs):
self.apps = args
+ # Get the version of the test suite
self.version = self.get_test_version()
+ # Call the appropriate one
if self.version == 'new':
self._new_tests()
else:
self._old_tests()
def get_test_version(self):
+ """
+ Figure out which version of Django's test suite we have to play with.
+ """
from django import VERSION
if VERSION[0] == 1 and VERSION[1] >= 2:
return 'new'
else:
return 'old'
def _old_tests(self):
+ """
+ Fire up the Django test suite from before version 1.2
+ """
settings.configure(DEBUG = True,
DATABASE_ENGINE = 'sqlite3',
DATABASE_NAME = os.path.join(self.DIRNAME, 'database.db'),
- INSTALLED_APPS = self.INSTALLED_APPS
+ INSTALLED_APPS = self.INSTALLED_APPS + self.apps
)
from django.test.simple import run_tests
failures = run_tests(self.apps, verbosity=1)
if failures:
sys.exit(failures)
def _new_tests(self):
+ """
+ Fire up the Django test suite developed for version 1.2
+ """
settings.configure(
DEBUG = True,
DATABASES = {
@@ -63,14 +73,22 @@ def _new_tests(self):
'PORT': '',
}
},
- INSTALLED_APPS = self.INSTALLED_APPS
+ INSTALLED_APPS = self.INSTALLED_APPS + self.apps
)
from django.test.simple import DjangoTestSuiteRunner
failures = DjangoTestSuiteRunner().run_tests(self.apps, verbosity=1)
if failures:
sys.exit(failures)
if __name__ == '__main__':
+ """
+ What do when the user hits this file from the shell.
+
+ Example usage:
+
+ $ python qiktest.py app1 app2
+
+ """
parser = argparse.ArgumentParser(
usage="[args]",
description="Run Django tests on the provided applications."

0 comments on commit 7a72eb8

Please sign in to comment.
Something went wrong with that request. Please try again.