summaryrefslogtreecommitdiffstats
path: root/config/rpm
diff options
context:
space:
mode:
authorChris Church <chris@ninemoreminutes.com>2013-06-28 12:07:58 +0200
committerChris Church <chris@ninemoreminutes.com>2013-06-28 12:07:58 +0200
commit15dd0039c7c76ff6e35769510022bfbebac94e5f (patch)
tree0d2b90b024cc4f2793a796e8d7e0501aa294d9b6 /config/rpm
parentFix to not require explicit port specification in REST_API_URL. (diff)
downloadawx-15dd0039c7c76ff6e35769510022bfbebac94e5f.tar.xz
awx-15dd0039c7c76ff6e35769510022bfbebac94e5f.zip
Added setting for production builds to be able to run tests using SQLite.
Diffstat (limited to 'config/rpm')
-rw-r--r--config/rpm/settings.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/config/rpm/settings.py b/config/rpm/settings.py
index 1ecde70c37..ce0d2c5e16 100644
--- a/config/rpm/settings.py
+++ b/config/rpm/settings.py
@@ -13,6 +13,17 @@ DATABASES = {
}
}
+# Use SQLite for unit tests instead of PostgreSQL.
+if len(sys.argv) >= 2 and sys.argv[1] == 'test':
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': 'var/lib/awx/awx.sqlite3',
+ # Test database cannot be :memory: for celery/inventory tests.
+ 'TEST_NAME': '/var/lib/awx/awx_test.sqlite3',
+ }
+ }
+
STATIC_ROOT = '/var/lib/awx/public/static'
PROJECTS_ROOT = '/var/lib/awx/projects'