Tests being configured.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2023-11-22 11:55:51 -05:00
parent c4800a746d
commit 68c50ff824
3 changed files with 48 additions and 3 deletions

View File

@@ -138,7 +138,7 @@ def test_should_not_delete_invitations_less_than_two_days_old(
make_invitation(
sample_user,
sample_service,
age=two_days - one_second, # Not quite two days
age=two_days - one_second, # Not quite two days
email_address="valid@2.com",
)
make_invitation(

View File

@@ -15,6 +15,8 @@ from app.models import (
NOTIFICATION_TECHNICAL_FAILURE,
SMS_TYPE,
Agreement,
AgreementStatus,
AgreementType,
AnnualBilling,
Notification,
NotificationHistory,
@@ -28,6 +30,7 @@ from app.models import (
from tests.app.db import (
create_inbound_number,
create_notification,
create_organization,
create_rate,
create_reply_to_email,
create_service,
@@ -412,6 +415,46 @@ def test_rate_str():
assert rate.__str__() == "1.5 sms 2023-01-01 00:00:00"
@pytest.mark.parametrize(
["agreement_type", "expected"],
(
(AgreementType.IAA, False),
(AgreementType.MOU, True),
),
)
def test_organization_agreement_mou(notify_db_session, agreement_type, expected):
now = datetime.utcnow()
agree = Agreement()
agree.id = "whatever"
agree.start_time = now
agree.end_time = now
agree.status = AgreementStatus.ACTIVE
agree.type = agreement_type
organization = create_organization(name="Something")
organization.agreements.append(agree)
assert organization.has_mou == expected
@pytest.mark.parametrize(
["agreement_status", "expected"],
(
(AgreementStatus.EXPIRED, False),
(AgreementStatus.ACTIVE, True),
),
)
def test_organization_agreement_active(notify_db_session, agreement_status, expected):
now = datetime.utcnow()
agree = Agreement()
agree.id = "whatever"
agree.start_time = now
agree.end_time = now
agree.status = agreement_status
agree.type = AgreementType.IAA
organization = create_organization(name="Something")
organization.agreements.append(agree)
assert organization.active == expected
def test_agreement_serialize():
agree = Agreement()
agree.id = "abc"