mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 15:05:59 +08:00
only SERVER_NAME in test
This commit is contained in:
parent
682ac75585
commit
6bf8cddbcd
|
@ -1,5 +1,4 @@
|
|||
# Server url
|
||||
SERVER_NAME=sl.local
|
||||
URL=http://sl-server:7777
|
||||
|
||||
EMAIL_DOMAIN=sl.local
|
||||
|
|
|
@ -24,7 +24,6 @@ else:
|
|||
load_dotenv()
|
||||
|
||||
|
||||
SERVER_NAME = os.environ["SERVER_NAME"]
|
||||
URL = os.environ["URL"]
|
||||
print("URL:", URL)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue