about summary refs log tree commit diff
path: root/tests/unit/conftest.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-12-22 09:45:20 +0300
committerFrederick Muriuki Muriithi2022-12-22 09:45:20 +0300
commit8e055558e2e12250fd744caa2b9b3078a3025208 (patch)
tree1afebda7925e568afaf978b29e8b666e94e27ca8 /tests/unit/conftest.py
parentb0641272491eb51d321b1b8a7d062e395e70800f (diff)
downloadgenenetwork3-8e055558e2e12250fd744caa2b9b3078a3025208.tar.gz
tests: Setup environment variables and configs
* gn3/settings.py: leave `OAUTH2_ACCESS_TOKEN_GENERATOR` in its default
  setting
* tests/unit/auth/fixtures/oauth2_client_fixtures.py: setup
  `AUTHLIB_INSECURE_TRANSPORT` before running the OAuth2 tests
* tests/unit/conftest.py: setup the test application's configuration correctly
  for the tests.
Diffstat (limited to 'tests/unit/conftest.py')
-rw-r--r--tests/unit/conftest.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py
index e5d941d..3020f88 100644
--- a/tests/unit/conftest.py
+++ b/tests/unit/conftest.py
@@ -14,8 +14,10 @@ def test_app():
     with TemporaryDirectory() as testdir:
         testdb = Path(testdir).joinpath(
             f'testdb_{datetime.now().strftime("%Y%m%dT%H%M%S")}')
-        app = create_app()
-        app.config.update({"TESTING": True, "AUTH_DB": testdb})
+        app = create_app({
+            "TESTING": True, "AUTH_DB": testdb,
+            "OAUTH2_ACCESS_TOKEN_GENERATOR": "tests.unit.auth.test_token.gen_token"
+        })
         app.testing = True
         yield app
         # Clean up after ourselves