From 649ac89e2e13eced31ca1e451e8ecb53673240c1 Mon Sep 17 00:00:00 2001 From: dandds Date: Thu, 2 Aug 2018 16:20:54 -0400 Subject: [PATCH] configure test environment --- README.md | 6 ++++++ atst/app.py | 2 +- atst/ui_methods.py | 2 +- script/test | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 455d5baa..5bfee424 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,12 @@ To log in as one of them, navigate to `/login-dev?username=`. Fo ## Testing +Tests require a test database: + +``` +createdb atat_test +``` + To run lint, static analysis, and unit tests: script/test diff --git a/atst/app.py b/atst/app.py index ca6ad7e2..5e45af43 100644 --- a/atst/app.py +++ b/atst/app.py @@ -12,7 +12,7 @@ from atst.routes.workspaces import bp as workspace_routes from atst.routes.requests import requests_bp -ENV = os.getenv("TORNADO_ENV", "dev") +ENV = os.getenv("FLASK_ENV", "dev") def make_app(config): diff --git a/atst/ui_methods.py b/atst/ui_methods.py index c863ee55..a3ccbbba 100644 --- a/atst/ui_methods.py +++ b/atst/ui_methods.py @@ -11,7 +11,7 @@ def navigationContext(self): def dev(self): - return os.getenv("TORNADO_ENV", "dev") == "dev" + return os.getenv("FLASK_ENV", "dev") == "dev" def matchesPath(self, href): diff --git a/script/test b/script/test index 1f6c3380..ceb1c5c2 100755 --- a/script/test +++ b/script/test @@ -4,6 +4,8 @@ source "$(dirname "${0}")"/../script/include/global_header.inc.sh +export FLASK_ENV=test + # Define all relevant python files and directories for this app PYTHON_FILES="./app.py ./atst ./config"