-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-ml-id-column-sites
- Loading branch information
Showing
5 changed files
with
24 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
UserSQL, | ||
) | ||
|
||
__version__ = "1.0.36" | ||
__version__ = "1.0.37" |
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 |
---|---|---|
@@ -1,22 +1,28 @@ | ||
from pvsite_datamodel import UserSQL | ||
from pvsite_datamodel import SiteGroupSQL, UserSQL | ||
from pvsite_datamodel.read import get_user_by_email | ||
from pvsite_datamodel.write.user_and_site import create_site_group, create_user | ||
|
||
|
||
class TestGetUserByEmail: | ||
"""Test for get_user_by_email function""" | ||
|
||
def test_get_user_by_email_no_users_site_group_exists(self, db_session): | ||
_ = create_site_group(db_session=db_session, site_group_name="[email protected]") | ||
_ = get_user_by_email(session=db_session, email="[email protected]") | ||
assert len(db_session.query(UserSQL).all()) == 1 | ||
assert len(db_session.query(SiteGroupSQL).all()) == 1 | ||
|
||
def test_get_user_by_email_no_users(self, db_session): | ||
user = get_user_by_email(session=db_session, email="[email protected]") | ||
assert user.email == "[email protected]" | ||
assert len(db_session.query(UserSQL).all()) == 1 | ||
|
||
def test_get_user_by_email_with_users(self, db_session): | ||
site_group = create_site_group(db_session=db_session) | ||
user = create_user( | ||
_ = create_user( | ||
session=db_session, site_group_name=site_group.site_group_name, email="[email protected]" | ||
) | ||
user = create_user( | ||
_ = create_user( | ||
session=db_session, site_group_name=site_group.site_group_name, email="[email protected]" | ||
) | ||
|
||
|