diff options
author | Chris Church <chris@ninemoreminutes.com> | 2013-06-28 12:07:58 +0200 |
---|---|---|
committer | Chris Church <chris@ninemoreminutes.com> | 2013-06-28 12:07:58 +0200 |
commit | 15dd0039c7c76ff6e35769510022bfbebac94e5f (patch) | |
tree | 0d2b90b024cc4f2793a796e8d7e0501aa294d9b6 /config | |
parent | Fix to not require explicit port specification in REST_API_URL. (diff) | |
download | awx-15dd0039c7c76ff6e35769510022bfbebac94e5f.tar.xz awx-15dd0039c7c76ff6e35769510022bfbebac94e5f.zip |
Added setting for production builds to be able to run tests using SQLite.
Diffstat (limited to 'config')
-rw-r--r-- | config/deb/settings.py | 11 | ||||
-rw-r--r-- | config/rpm/settings.py | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/config/deb/settings.py b/config/deb/settings.py index c53f6a479a..1b020775d9 100644 --- a/config/deb/settings.py +++ b/config/deb/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' 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' |