diff --git a/chat/tests.py b/chat/tests.py index 7ce503c..f6ea0fd 100644 --- a/chat/tests.py +++ b/chat/tests.py @@ -1,3 +1,6 @@ from django.test import TestCase -# Create your tests here. +class SmokeTest(TestCase): + def test_truth(self): + self.assertTrue(True) + diff --git a/project/settings.py b/project/settings.py index f8fa61c..4197848 100644 --- a/project/settings.py +++ b/project/settings.py @@ -10,7 +10,8 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = os.environ['DJANGO_SECRET_KEY'] +# Provide a fallback secret key for local testing environments +SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'test-secret-key') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -109,14 +110,15 @@ STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') -CELERY_BROKER_URL = os.environ['REDIS_URL'] -CELERY_RESULT_BACKEND = os.environ['REDIS_URL'] +REDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost:6379/0') +CELERY_BROKER_URL = REDIS_URL +CELERY_RESULT_BACKEND = REDIS_URL CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': { - "hosts": [os.environ['REDIS_URL']], + "hosts": [REDIS_URL], }, }, } @@ -124,7 +126,7 @@ CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": os.environ['REDIS_URL'], + "LOCATION": REDIS_URL, "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient" }