Skip to content

Commit

Permalink
test: Ensure that validate tokens routes works
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik003 committed Oct 16, 2023
1 parent 8f3de30 commit e25b14a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
21 changes: 21 additions & 0 deletions backend/tests/users/test_oauth.py
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion backend/tests/users/test_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit e25b14a

Please sign in to comment.