-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
157c2c4
commit 6e5a1b4
Showing
4 changed files
with
45 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import pytest | ||
|
||
from app.core.user import create_admin, create_user | ||
from tests.conftest import User, override_get_async_session, settings | ||
|
||
|
||
@pytest.mark.asyncio | ||
@pytest.mark.parametrize('is_superuser', (True, False)) | ||
async def test_create_user(is_superuser) -> None: | ||
user: User = await create_user(override_get_async_session, | ||
settings.admin_email, | ||
settings.admin_password, | ||
is_superuser=is_superuser) | ||
assert user.email == settings.admin_email | ||
assert user.hashed_password | ||
assert user.is_superuser == is_superuser | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_create_admin() -> None: | ||
user: User = await create_admin(override_get_async_session) | ||
assert user.email == settings.admin_email | ||
assert user.hashed_password | ||
assert user.is_superuser |