mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-05 15:09:32 +00:00
Force testing settings during test
This commit is contained in:
parent
93aaf119c5
commit
4377160155
2 changed files with 10 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
import secrets
|
||||
import sys
|
||||
import urllib.parse
|
||||
from pathlib import Path
|
||||
from typing import List, Literal, Optional, Union
|
||||
|
@ -105,7 +106,7 @@ class Settings(BaseSettings):
|
|||
}
|
||||
|
||||
|
||||
SETUP = Settings()
|
||||
SETUP = Settings(_env_file="test.env" if "pytest" in sys.modules else None)
|
||||
|
||||
SECRET_KEY = SETUP.SECRET_KEY
|
||||
DEBUG = SETUP.DEBUG
|
||||
|
|
8
test.env
Normal file
8
test.env
Normal file
|
@ -0,0 +1,8 @@
|
|||
TAKAHE_DATABASE_SERVER="postgres://postgres@localhost/takahe"
|
||||
TAKAHE_DEBUG=true
|
||||
TAKAHE_SECRET_KEY="insecure_secret"
|
||||
TAKAHE_CSRF_TRUSTED_ORIGINS=["http://127.0.0.1:8000", "https://127.0.0.1:8000"]
|
||||
TAKAHE_USE_PROXY_HEADERS=true
|
||||
TAKAHE_EMAIL_SERVER="console://console"
|
||||
TAKAHE_MAIN_DOMAIN="example.com"
|
||||
TAKAHE_ENVIRONMENT="development"
|
Loading…
Reference in a new issue