From 8e055558e2e12250fd744caa2b9b3078a3025208 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 22 Dec 2022 09:45:20 +0300 Subject: 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. --- tests/unit/auth/fixtures/oauth2_client_fixtures.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/unit/auth/fixtures') 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.""" -- cgit v1.2.3