mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Added setting for production builds to be able to run tests using SQLite.
This commit is contained in:
parent
395685b23b
commit
15dd0039c7
@ -22,13 +22,13 @@ DATABASES = {
|
||||
}
|
||||
}
|
||||
|
||||
# Continue to use SQLite for unit tests instead of PostgreSQL.
|
||||
if 'test' in sys.argv:
|
||||
# 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': os.path.join(BASE_DIR, 'awx.sqlite3'),
|
||||
# Test database cannot be :memory: for celery/inventory tests to work.
|
||||
# Test database cannot be :memory: for celery/inventory tests.
|
||||
'TEST_NAME': os.path.join(BASE_DIR, 'awx_test.sqlite3'),
|
||||
}
|
||||
}
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user