Commits

Anonymous committed 4620ea0

Test configuration

Comments (0)

Files changed (4)

+#!/usr/bin/env python
+import os, sys
+
+if __name__ == "__main__":
+    sys.path.append(os.path.dirname(os.path.dirname(__file__)))
+
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rentalerts.settings.testing")
+
+    from django.core.management import call_command
+    from django.conf import settings
+
+    apps_for_testing = [app[16:] for app in settings.INSTALLED_APPS
+            if app.startswith("rentalerts.apps")]
+
+    call_command("test", *apps_for_testing)
 class Server(object):
 
     manager = "manage.py"
+    testrunner = None
     app_name = "rentalerts"
     runtests = True
     python_exec = "python"
     server.conf_dir = "%s/conf/production" % server.dir
     server.python_exec = "/home/danjac354/.virtualenvs/rentalerts/bin/python2.7"
     server.manager = "%s ./bin/production" % server.python_exec
+    server.testrunner = "%s ./bin/runtests" % server.python_exec
 
     api.env.hosts = ['danjac354.webfactional.com']
     api.env.user = 'danjac354'
 def tests():
 
 
-    with api.cd(server.dirname):
-        api.run("%s test pm site helpers alerts accounts apartments" % server.manager)
+    with api.cd(server.dir):
+        api.run(server.testrunner)
 
 
 @api.task

rentalerts/settings/base.py

         'PASSWORD': '',
         'HOST': '',
         'PORT': '',
-        'TEST_NAME' : 'testing',
     },
     'testing' : {
         'ENGINE' : 'django.db.backends.sqlite3',

rentalerts/settings/testing.py

+from .base import *
+
+DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3'