Got tests to use OrganizationType everywhere now.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-02-28 12:43:37 -05:00
parent b3223f84cc
commit 8907edc194
8 changed files with 53 additions and 48 deletions
+11 -11
View File
@@ -40,7 +40,7 @@ from app.dao.services_dao import (
get_services_by_partial_name,
)
from app.dao.users_dao import create_user_code, save_model_user
from app.enums import KeyType
from app.enums import KeyType, OrganizationType
from app.models import (
ApiKey,
InvitedUser,
@@ -85,7 +85,7 @@ def test_create_service(notify_db_session):
email_from="email_from",
message_limit=1000,
restricted=False,
organization_type="federal",
organization_type=OrganizationType.FEDERAL,
created_by=user,
)
dao_create_service(service, user)
@@ -97,7 +97,7 @@ def test_create_service(notify_db_session):
assert service_db.prefix_sms is True
assert service.active is True
assert user in service_db.users
assert service_db.organization_type == "federal"
assert service_db.organization_type == OrganizationType.FEDERAL
assert not service.organization_id
@@ -105,7 +105,7 @@ def test_create_service_with_organization(notify_db_session):
user = create_user(email="local.authority@local-authority.gov.uk")
organization = create_organization(
name="Some local authority",
organization_type="state",
organization_type=OrganizationType.STATE,
domains=["local-authority.gov.uk"],
)
assert Service.query.count() == 0
@@ -114,7 +114,7 @@ def test_create_service_with_organization(notify_db_session):
email_from="email_from",
message_limit=1000,
restricted=False,
organization_type="federal",
organization_type=OrganizationType.FEDERAL,
created_by=user,
)
dao_create_service(service, user)
@@ -127,7 +127,7 @@ def test_create_service_with_organization(notify_db_session):
assert service_db.prefix_sms is True
assert service.active is True
assert user in service_db.users
assert service_db.organization_type == "state"
assert service_db.organization_type == OrganizationType.STATE
assert service.organization_id == organization.id
assert service.organization == organization
@@ -136,7 +136,7 @@ def test_fetch_service_by_id_with_api_keys(notify_db_session):
user = create_user(email="local.authority@local-authority.gov.uk")
organization = create_organization(
name="Some local authority",
organization_type="state",
organization_type=OrganizationType.STATE,
domains=["local-authority.gov.uk"],
)
assert Service.query.count() == 0
@@ -145,7 +145,7 @@ def test_fetch_service_by_id_with_api_keys(notify_db_session):
email_from="email_from",
message_limit=1000,
restricted=False,
organization_type="federal",
organization_type=OrganizationType.FEDERAL,
created_by=user,
)
dao_create_service(service, user)
@@ -158,7 +158,7 @@ def test_fetch_service_by_id_with_api_keys(notify_db_session):
assert service_db.prefix_sms is True
assert service.active is True
assert user in service_db.users
assert service_db.organization_type == "state"
assert service_db.organization_type == OrganizationType.STATE
assert service.organization_id == organization.id
assert service.organization == organization
@@ -491,7 +491,7 @@ def test_get_all_user_services_should_return_empty_list_if_no_services_for_user(
@freeze_time("2019-04-23T10:00:00")
def test_dao_fetch_live_services_data(sample_user):
org = create_organization(organization_type="federal")
org = create_organization(organization_type=OrganizationType.FEDERAL)
service = create_service(go_live_user=sample_user, go_live_at="2014-04-20T10:00:00")
sms_template = create_template(service=service)
service_2 = create_service(
@@ -530,7 +530,7 @@ def test_dao_fetch_live_services_data(sample_user):
"service_id": mock.ANY,
"service_name": "Sample service",
"organization_name": "test_org_1",
"organization_type": "federal",
"organization_type": OrganizationType.FEDERAL,
"consent_to_research": None,
"contact_name": "Test User",
"contact_email": "notify@digital.fake.gov",