[tests] speedup the tests a bit by using a in memory database

django-5.0
Thomas Leichtfuß 2020-09-12 21:26:17 +02:00
parent 4cae52ee94
commit 76a8b603f5
1 changed files with 6 additions and 2 deletions

View File

@ -76,11 +76,15 @@ WSGI_APPLICATION = 'testapp.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
if 'test' in sys.argv:
DB_NAME = ':memory:'
else:
DB_NAME = os.path.join(BASE_DIR, 'db.sqlite3')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': ':memory:',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'NAME': DB_NAME,
}
}