2021-12-26 04:46:14 +00:00
|
|
|
commit e6833a2d52849e01dfeb3fe4a88093678fd88d93
|
|
|
|
Author: John Vandenberg <jayvdb@gmail.com>
|
|
|
|
Date: Sun Dec 26 12:31:12 2021 +0800
|
|
|
|
|
|
|
|
Allow running tests using sqlite
|
|
|
|
|
|
|
|
diff --git a/tests/settings.py b/tests/settings.py
|
|
|
|
index 4ead542..83946b3 100644
|
|
|
|
--- a/tests/settings.py
|
|
|
|
+++ b/tests/settings.py
|
|
|
|
@@ -4,16 +4,25 @@ INSTALLED_APPS = (
|
|
|
|
'model_utils',
|
2019-07-02 12:22:58 +00:00
|
|
|
'tests',
|
|
|
|
)
|
2021-12-26 04:46:14 +00:00
|
|
|
-DATABASES = {
|
2019-07-02 12:22:58 +00:00
|
|
|
- "default": {
|
|
|
|
- "ENGINE": "django.db.backends.postgresql_psycopg2",
|
2021-12-26 04:46:14 +00:00
|
|
|
- "NAME": os.environ.get("DB_NAME", "modelutils"),
|
|
|
|
- "USER": os.environ.get("DB_USER", 'postgres'),
|
|
|
|
- "PASSWORD": os.environ.get("DB_PASSWORD", ""),
|
|
|
|
- "HOST": os.environ.get("DB_HOST", "localhost"),
|
|
|
|
- "PORT": os.environ.get("DB_PORT", 5432)
|
|
|
|
- },
|
|
|
|
-}
|
|
|
|
+
|
|
|
|
+if os.environ.get('SQLITE'):
|
|
|
|
+ DATABASES = {
|
|
|
|
+ 'default': {
|
|
|
|
+ 'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+else:
|
|
|
|
+ DATABASES = {
|
|
|
|
+ "default": {
|
|
|
|
+ "ENGINE": "django.db.backends.postgresql_psycopg2",
|
|
|
|
+ "NAME": os.environ.get("DB_NAME", "modelutils"),
|
|
|
|
+ "USER": os.environ.get("DB_USER", 'postgres'),
|
|
|
|
+ "PASSWORD": os.environ.get("DB_PASSWORD", ""),
|
|
|
|
+ "HOST": os.environ.get("DB_HOST", "localhost"),
|
|
|
|
+ "PORT": os.environ.get("DB_PORT", 5432)
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+
|
2019-07-02 12:22:58 +00:00
|
|
|
SECRET_KEY = 'dummy'
|
2021-12-26 04:46:14 +00:00
|
|
|
|
|
|
|
CACHES = {
|