diff options
-rw-r--r-- | gn3/settings.py | 4 | ||||
-rw-r--r-- | tests/unit/auth/fixtures/oauth2_client_fixtures.py | 4 | ||||
-rw-r--r-- | tests/unit/conftest.py | 6 |
3 files changed, 8 insertions, 6 deletions
diff --git a/gn3/settings.py b/gn3/settings.py index 70af723..5fec562 100644 --- a/gn3/settings.py +++ b/gn3/settings.py @@ -67,7 +67,3 @@ MULTIPROCESSOR_PROCS = 6 # Number of processes to spawn AUTH_MIGRATIONS = "migrations/auth" AUTH_DB = os.environ.get( "AUTH_DB", f"{os.environ.get('HOME')}/genenetwork/gn3_files/db/auth.db") - -## OAuth2 Settings -OAUTH2_ACCESS_TOKEN_GENERATOR = os.environ.get( - "OAUTH2_ACCESS_TOKEN_GENERATOR", True) diff --git a/tests/unit/auth/fixtures/oauth2_client_fixtures.py b/tests/unit/auth/fixtures/oauth2_client_fixtures.py index 751eadd..03a53d7 100644 --- a/tests/unit/auth/fixtures/oauth2_client_fixtures.py +++ b/tests/unit/auth/fixtures/oauth2_client_fixtures.py @@ -8,6 +8,10 @@ import pytest from gn3.auth import db from gn3.auth.authentication.oauth2.models.oauth2client import OAuth2Client +@pytest.fixture(autouse=True) +def fixture_patch_envvars(monkeypatch): + monkeypatch.setenv("AUTHLIB_INSECURE_TRANSPORT", "true") + @pytest.fixture def fixture_oauth2_clients(fixture_users_with_passwords): """Fixture: Create the OAuth2 clients for use with tests.""" 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 |