Fix EXTERNAL_HOST computations in test_settings.py.

test_settings.py was setting EXTERNAL_HOST after importing settings.py,
which has several variables (like SERVER_URI) that are computed from
EXTERNAL_HOST.

[tweaked by tabbott to add comments explaining the story here].
This commit is contained in:
Rishi Gupta
2016-10-05 16:42:24 -07:00
committed by Tim Abbott
parent 5357b286b2
commit d387012bc6
3 changed files with 30 additions and 11 deletions

View File

@@ -2,9 +2,12 @@
# For the Dev VM environment, we use the same settings as the
# sample prod_settings.py file, with a few exceptions.
from .prod_settings_template import *
import os
LOCAL_UPLOADS_DIR = 'var/uploads'
EXTERNAL_HOST = 'zulipdev.com:9991'
# We check the environment to support test_settings.py controlling
# EXTERNAL_HOST.
EXTERNAL_HOST = os.getenv('EXTERNAL_HOST', 'zulipdev.com:9991')
ALLOWED_HOSTS = ['*']
AUTHENTICATION_BACKENDS = ('zproject.backends.DevAuthBackend',)
# Add some of the below if you're testing other backends