diff --git a/backend/tests/blueprints/test_members.py b/backend/tests/blueprints/test_members.py index 2f49025..09feb23 100644 --- a/backend/tests/blueprints/test_members.py +++ b/backend/tests/blueprints/test_members.py @@ -2,6 +2,7 @@ import pytest from freezegun import freeze_time from itsdangerous import URLSafeTimedSerializer from quart import Quart +from quart_auth import authenticated_client from backend.blueprints.members import EMAIL_VERIFICATION_SALT @@ -44,7 +45,7 @@ async def test_change_password(app: Quart, caplog: pytest.LogCaptureFixture) -> "password": "testPassword2$", } response = await test_client.post("/members/", json=data) - async with test_client.authenticated("2"): # type: ignore + async with authenticated_client(test_client, auth_id=2): # type: ignore response = await test_client.put( "/members/password/", json={ diff --git a/backend/tests/blueprints/test_todos.py b/backend/tests/blueprints/test_todos.py index 7f47c0f..c8f75ae 100644 --- a/backend/tests/blueprints/test_todos.py +++ b/backend/tests/blueprints/test_todos.py @@ -1,9 +1,10 @@ from quart import Quart +from quart_auth import authenticated_client async def test_post_todo(app: Quart) -> None: test_client = app.test_client() - async with test_client.authenticated("1"): # type: ignore + async with authenticated_client(test_client, auth_id=1): # type: ignore response = await test_client.post( "/todos/", json={"complete": False, "due": None, "task": "Test task"}, @@ -14,7 +15,7 @@ async def test_post_todo(app: Quart) -> None: async def test_get_todo(app: Quart) -> None: test_client = app.test_client() - async with test_client.authenticated("1"): # type: ignore + async with authenticated_client(test_client, auth_id=1): # type: ignore response = await test_client.get("/todos/1/") assert response.status_code == 200 assert (await response.get_json())["task"] == "Test Task" @@ -22,7 +23,7 @@ async def test_get_todo(app: Quart) -> None: async def test_put_todo(app: Quart) -> None: test_client = app.test_client() - async with test_client.authenticated("1"): # type: ignore + async with authenticated_client(test_client, auth_id=1): # type: ignore response = await test_client.post( "/todos/", json={"complete": False, "due": None, "task": "Test task"}, @@ -41,7 +42,7 @@ async def test_put_todo(app: Quart) -> None: async def test_delete_todo(app: Quart) -> None: test_client = app.test_client() - async with test_client.authenticated("1"): # type: ignore + async with authenticated_client(test_client, auth_id=1): # type: ignore response = await test_client.post( "/todos/", json={"complete": False, "due": None, "task": "Test task"},