Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More base stuff

  • Loading branch information...
commit f206cac9f45aa49e9a5a26cea00d63188715bca4 1 parent b4fac1a
@pydanny pydanny authored
View
2  handstand_project/core/tests/utils.py → handstand_project/core/test_utils.py
@@ -25,7 +25,7 @@ def setUp(self):
"""
usage::
- from core.test_utils import BaseTestCase
+ from core.tests_utils import BaseTestCase
class MyTest(BaseTestCase):
def setUp(self):
View
20 handstand_project/settings/base.py
@@ -101,7 +101,7 @@
os.path.join(PROJECT_ROOT, 'templates'),
)
-INSTALLED_APPS = (
+PREREQ_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
@@ -114,8 +114,26 @@
'social_auth',
'profiles',
'django_extensions',
+ 'django_coverage',
)
+PROJECT_APPS = ()
+
+if PROJECT_APPS:
+ INSTALLED_APPS = PREREQ_APPS + PROJECT_APPS
+else:
+ INSTALLED_APPS = PREREQ_APPS
+
+########## BEGIN TESTRUNNER CONFIGURATION
+TEST_RUNNER = 'testrunner.OurCoverageRunner'
+COVERAGE_MODULE_EXCLUDES = [
+ 'tests$', 'settings$', 'urls$', 'locale$','admin',
+ 'migrations', 'fixtures','debug_toolbar','djkombu',
+]
+COVERAGE_MODULE_EXCLUDES += PREREQ_APPS
+COVERAGE_REPORT_HTML_OUTPUT_DIR = "coverage"
+########## END TESTRUNNER CONFIGURATION
+
AUTH_PROFILE_MODULE = "profiles.Profile"
TEMPLATE_CONTEXT_PROCESSORS = [
View
4 handstand_project/settings/dev.py
@@ -6,8 +6,8 @@
# Locally, it's easiest to use your own user account to createdb/dropdb
DATABASES = {
'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'handstand', # Or path to database file if using sqlite3.
+ 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+ 'NAME': 'handstand.db', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
View
13 handstand_project/testrunner.py
@@ -0,0 +1,13 @@
+# Make our own testrunner that by default only tests our own apps
+
+from django.conf import settings
+from django.test.simple import DjangoTestSuiteRunner
+from django_coverage.coverage_runner import CoverageRunner
+
+class OurTestRunner(DjangoTestSuiteRunner):
+ def build_suite(self, test_labels, *args, **kwargs):
+ return super(OurTestRunner, self).build_suite(test_labels or settings.PROJECT_APPS, *args, **kwargs)
+
+class OurCoverageRunner(OurTestRunner, CoverageRunner):
+ pass
+
Please sign in to comment.
Something went wrong with that request. Please try again.