diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-04 15:13:59 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-04 15:13:59 +0530 |
commit | 7df72bb7d053f05599a04922107512bd239f382f (patch) | |
tree | b60a9f3bc24c27e1c4708edf3bd79513ada92835 | |
parent | 9ddea082598f762df223c96e1af71e78f66b3cfd (diff) |
disable csrf while testing and create dummy db
-rw-r--r-- | app/tests/conftest.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/tests/conftest.py b/app/tests/conftest.py index 3842091..1da24d3 100644 --- a/app/tests/conftest.py +++ b/app/tests/conftest.py @@ -1,11 +1,17 @@ import pytest from app import app as flask_app +from app import db +import tempfile +import os @pytest.fixture def app(): + flask_app.config['WTF_CSRF_ENABLED'] = False + flask_app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///" + tempfile.mkstemp(suffix='.db')[-1] + db.create_all() yield flask_app @pytest.fixture def client(app): - return app.test_client()
\ No newline at end of file + return app.test_client() |