mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-25 00:33:41 -04:00
Debugging things is fun.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -169,7 +169,9 @@ def test_update_organization_updates_the_service_org_type_if_org_type_is_provide
|
||||
sample_organization.services.append(sample_service)
|
||||
db.session.commit()
|
||||
|
||||
dao_update_organization(sample_organization.id, organization_type=OrganizationType.FEDERAL)
|
||||
dao_update_organization(
|
||||
sample_organization.id, organization_type=OrganizationType.FEDERAL
|
||||
)
|
||||
|
||||
assert sample_organization.organization_type == OrganizationType.FEDERAL
|
||||
assert sample_service.organization_type == OrganizationType.FEDERAL
|
||||
|
||||
@@ -26,7 +26,13 @@ from app.dao.service_sms_sender_dao import (
|
||||
from app.dao.services_dao import dao_add_user_to_service, dao_create_service
|
||||
from app.dao.templates_dao import dao_create_template, dao_update_template
|
||||
from app.dao.users_dao import save_model_user
|
||||
from app.enums import KeyType, OrganizationType, RecipientType, ServicePermissionType, TemplateType
|
||||
from app.enums import (
|
||||
KeyType,
|
||||
OrganizationType,
|
||||
RecipientType,
|
||||
ServicePermissionType,
|
||||
TemplateType,
|
||||
)
|
||||
from app.models import (
|
||||
AnnualBilling,
|
||||
ApiKey,
|
||||
|
||||
@@ -26,7 +26,9 @@ from tests.app.db import (
|
||||
|
||||
|
||||
def test_get_all_organizations(admin_request, notify_db_session):
|
||||
create_organization(name="inactive org", active=False, organization_type=OrganizationType.FEDERAL)
|
||||
create_organization(
|
||||
name="inactive org", active=False, organization_type=OrganizationType.FEDERAL
|
||||
)
|
||||
create_organization(name="active org", domains=["example.com"])
|
||||
|
||||
response = admin_request.get("organization.get_organizations", _expected_status=200)
|
||||
|
||||
@@ -14,7 +14,13 @@ from app.dao.service_user_dao import dao_get_service_user
|
||||
from app.dao.services_dao import dao_add_user_to_service, dao_remove_user_from_service
|
||||
from app.dao.templates_dao import dao_redact_template
|
||||
from app.dao.users_dao import save_model_user
|
||||
from app.enums import KeyType, NotificationType, OrganizationType, ServicePermissionType, TemplateType
|
||||
from app.enums import (
|
||||
KeyType,
|
||||
NotificationType,
|
||||
OrganizationType,
|
||||
ServicePermissionType,
|
||||
TemplateType,
|
||||
)
|
||||
from app.models import (
|
||||
AnnualBilling,
|
||||
EmailBranding,
|
||||
|
||||
@@ -20,7 +20,7 @@ from app.commands import (
|
||||
)
|
||||
from app.dao.inbound_numbers_dao import dao_get_available_inbound_numbers
|
||||
from app.dao.users_dao import get_user_by_email
|
||||
from app.enums import KeyType, NotificationStatus, NotificationType, OrganizationType
|
||||
from app.enums import KeyType, NotificationStatus, NotificationType, OrganizationType, TemplateType
|
||||
from app.models import (
|
||||
AnnualBilling,
|
||||
Job,
|
||||
@@ -91,7 +91,7 @@ def test_purge_functional_test_data_bad_mobile(notify_db_session, notify_api):
|
||||
def test_update_jobs_archived_flag(notify_db_session, notify_api):
|
||||
service = create_service()
|
||||
|
||||
sms_template = create_template(service=service, template_type="sms")
|
||||
sms_template = create_template(service=service, template_type=TemplateType.SMS)
|
||||
create_job(sms_template)
|
||||
|
||||
right_now = datetime.datetime.utcnow()
|
||||
@@ -251,13 +251,14 @@ def test_insert_inbound_numbers_from_file(notify_db_session, notify_api, tmpdir)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"organization_type, expected_allowance", [(OrganizationType.FEDERAL, 40000), (OrganizationType.STATE, 40000)]
|
||||
"organization_type, expected_allowance",
|
||||
[(OrganizationType.FEDERAL, 40000), (OrganizationType.STATE, 40000)],
|
||||
)
|
||||
def test_populate_annual_billing_with_defaults(
|
||||
notify_db_session, notify_api, organization_type, expected_allowance
|
||||
):
|
||||
service = create_service(
|
||||
service_name=organization_type, organization_type=organization_type
|
||||
service_name=organization_type.value, organization_type=organization_type
|
||||
)
|
||||
|
||||
notify_api.test_cli_runner().invoke(
|
||||
@@ -274,13 +275,14 @@ def test_populate_annual_billing_with_defaults(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"organization_type, expected_allowance", [(OrganizationType.FEDERAL, 40000), (OrganizationType.STATE, 40000)]
|
||||
"organization_type, expected_allowance",
|
||||
[(OrganizationType.FEDERAL, 40000), (OrganizationType.STATE, 40000)],
|
||||
)
|
||||
def test_populate_annual_billing_with_the_previous_years_allowance(
|
||||
notify_db_session, notify_api, organization_type, expected_allowance
|
||||
):
|
||||
service = create_service(
|
||||
service_name=organization_type, organization_type=organization_type
|
||||
service_name=organization_type.value, organization_type=organization_type
|
||||
)
|
||||
|
||||
notify_api.test_cli_runner().invoke(
|
||||
|
||||
Reference in New Issue
Block a user