only SERVER_NAME in test

This commit is contained in:
Son NK 2019-07-12 11:57:17 +02:00 committed by Son NK
parent 682ac75585
commit 6bf8cddbcd
5 changed files with 3 additions and 6 deletions

View file

@ -1,5 +1,4 @@
# Server url
SERVER_NAME=sl.local
URL=http://sl-server:7777
EMAIL_DOMAIN=sl.local

View file

@ -24,7 +24,6 @@ else:
load_dotenv()
SERVER_NAME = os.environ["SERVER_NAME"]
URL = os.environ["URL"]
print("URL:", URL)

View file

@ -22,7 +22,6 @@ from app.config import (
SHA1,
LYRA_ANALYTICS_ID,
STRIPE_SECRET_KEY,
SERVER_NAME,
)
from app.dashboard.base import dashboard_bp
from app.developer.base import developer_bp
@ -50,8 +49,6 @@ def create_app() -> Flask:
app = Flask(__name__)
app.url_map.strict_slashes = False
app.config["SERVER_NAME"] = SERVER_NAME
app.config["SQLALCHEMY_DATABASE_URI"] = DB_URI
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
app.secret_key = FLASK_SECRET

View file

@ -23,6 +23,7 @@ def flask_app():
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://"
app.config["TESTING"] = True
app.config["WTF_CSRF_ENABLED"] = False
app.config["SERVER_NAME"] = "sl.test"
with app.app_context():
db.create_all()
@ -38,6 +39,7 @@ def flask_client():
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://"
app.config["TESTING"] = True
app.config["WTF_CSRF_ENABLED"] = False
app.config["SERVER_NAME"] = "sl.test"
client = app.test_client()

View file

@ -3,4 +3,4 @@ def test_redirect_login_page(flask_client):
rv = flask_client.get("/")
assert rv.status_code == 302
assert rv.location == "http://sl.local/auth/login"
assert rv.location == "http://sl.test/auth/login"