diff --git a/backend/tests/users/test_oauth.py b/backend/tests/users/test_oauth.py new file mode 100644 index 000000000..9ec6f59f2 --- /dev/null +++ b/backend/tests/users/test_oauth.py @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors +# SPDX-License-Identifier: Apache-2.0 + + +from fastapi import testclient +from sqlalchemy import orm + +from capellacollab.users import crud as users_crud +from capellacollab.users import models as users_models + + +def test_validate_tokens_routes( + db: orm.Session, + client: testclient.TestClient, + executor_name: str, +): + users_crud.create_user(db, executor_name, users_models.Role.ADMIN) + response = client.get("/api/v1/authentication/tokens") + + assert response.status_code == 200 + assert response.json() == executor_name diff --git a/backend/tests/users/test_tokens.py b/backend/tests/users/test_tokens.py index 024bbc67b..53ccee180 100644 --- a/backend/tests/users/test_tokens.py +++ b/backend/tests/users/test_tokens.py @@ -13,7 +13,6 @@ from capellacollab.__main__ import app from capellacollab.core.authentication.basic_auth import HTTPBasicAuth from capellacollab.users import models as users_models -from capellacollab.users.tokens import models as tokens_models POST_TOKEN = { "expiration_date": str(datetime.datetime.now()),