Add preliminary automated tests #1

Open
3wordchant wants to merge 5 commits from tests into master

5 Commits

Author SHA1 Message Date
forest 0268e4c97d ensure that app is defined in app.py to fix login link logging issues.
also shuffled some things around for cleanliness
2021-07-19 12:07:02 -05:00
3wc 7b9e9debab Disable VM creation check for the moment 2021-07-17 13:37:28 +02:00
3wc 9823bda4a2 Add SSH key tests 2021-07-17 12:10:28 +02:00
3wc 4c7caa1a38 Initial console tests
NB capsul create isn't working properly, see #83
2021-07-17 11:54:15 +02:00
3wc 665e087bd4 Basic testing using flask-testing
This commit makes it possible to override settings during tests, by
switching capsulflask/__init__.py to a "create_app" pattern, and using
`dotenv_values` instead of `load_dotenv`.

The create_app() method returns a Flask app instance, to give
more control over when to initialise the app. This allows setting
environment variables in test files.

Then, use dotenv_values to override loaded .env variables with ones from
the environment, so that tests can set `POSTGRES_CONNECTION_PARAMETERS`
and `SPOKE_MODEL` (possibly others in future..).

Inital tests for the "landing" pages, and login / activation, are
included.
2021-07-17 10:38:04 +02:00