Skip to content

Commit

Permalink
Feat: add users in school creation and deletion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotheem committed Dec 23, 2024
1 parent e42f94d commit a82d063
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def change_redis_client_status(activated: bool) -> None:
async def create_user_with_groups(
groups: list[GroupType],
account_type: AccountType = AccountType.student,
school_id: SchoolType = SchoolType.centrale_lyon,
school_id: SchoolType | str = SchoolType.centrale_lyon,
user_id: str | None = None,
email: str | None = None,
password: str | None = None,
Expand Down
13 changes: 13 additions & 0 deletions tests/test_schools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from app.core import models_core
from app.core.groups.groups_type import GroupType
from app.core.schools.schools_type import SchoolType
from tests.commons import (
add_object_to_db,
create_api_access_token,
Expand All @@ -30,6 +31,18 @@ async def init_objects() -> None:

admin_user = await create_user_with_groups([GroupType.admin])

await create_user_with_groups(
[],
school_id=id_test_ens,
email="[email protected]",
)

await create_user_with_groups(
[],
school_id=SchoolType.no_school,
email="[email protected]",
)


def test_read_schools(client: TestClient) -> None:
token = create_api_access_token(admin_user)
Expand Down

0 comments on commit a82d063

Please sign in to comment.