Skip to content

Commit

Permalink
add test for create_new_site_group
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-labri-tipton committed Oct 12, 2023
1 parent eb207e2 commit d74a677
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_get_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
add_site_to_site_group,
create_new_site,
create_user,
create_new_site_group,
get_all_users,
get_all_site_groups,
)
Expand Down Expand Up @@ -111,3 +112,22 @@ def test_create_user(db_session):
assert user_1.email == "[email protected]"
assert user_1.site_group.site_group_name == "test_site_group"
assert user_1.site_group_uuid == site_group_1.site_group_uuid


# test to create a new site group
def test_create_new_site_group(db_session):
"""Test to creat a new site group."""

site_1 = make_site(db_session=db_session, ml_id=1)
site_2 = make_site(db_session=db_session, ml_id=2)
site_3 = make_site(db_session=db_session, ml_id=3)

new_site_group = create_new_site_group(
session=db_session, site_group_name="new_site_group"
)
new_site_group.sites.append(site_1)
new_site_group.sites.append(site_2)
new_site_group.sites.append(site_3)

assert new_site_group.site_group_name == "new_site_group"
assert len(new_site_group.sites) == 3

0 comments on commit d74a677

Please sign in to comment.