From 91061a7b4af2aaa7c7c97d0cd215a0dc28a42419 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 7 Aug 2023 12:17:08 +0300 Subject: Fix tests --- tests/unit/auth/test_token.py | 2 +- tests/unit/conftest.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/unit/auth/test_token.py b/tests/unit/auth/test_token.py index f66954f..971e4de 100644 --- a/tests/unit/auth/test_token.py +++ b/tests/unit/auth/test_token.py @@ -53,7 +53,7 @@ def test_token(fxtr_app, fxtr_oauth2_clients, test_data, expected): "username": email, "password": password} with fxtr_app.test_client() as client, db.cursor(conn) as cursor: - res = client.post("/api/oauth2/token", data=data) + res = client.post("/auth/token", data=data) # cleanup db cursor.execute("DELETE FROM oauth2_tokens WHERE access_token=?", (gen_token(None, None, None, None),)) diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 4180528..2230f7a 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -5,7 +5,7 @@ from tempfile import TemporaryDirectory import pytest -from gn_auth.app import create_app +from gn_auth import create_app @pytest.fixture(scope="session") def fxtr_app(): @@ -16,7 +16,8 @@ def fxtr_app(): f'testdb_{datetime.now().strftime("%Y%m%dT%H%M%S")}') app = create_app({ "TESTING": True, "AUTH_DB": testdb, - "OAUTH2_ACCESS_TOKEN_GENERATOR": "tests.unit.auth.test_token.gen_token" + "OAUTH2_ACCESS_TOKEN_GENERATOR": "tests.unit.auth.test_token.gen_token", + "SECRET_KEY": "qQIrgiK29kXZU6v8D09y4uw_sk8I4cqgNZniYUrRoUk" }) app.testing = True yield app -- cgit v1.2.3