From e69531732268038e780628b93e0c6b5c1ba4ee8d Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Thu, 14 Mar 2024 20:34:47 +0000 Subject: [PATCH] test(form): form is valid for positive expiration values --- tests/pytest/core/test_admin.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/pytest/core/test_admin.py b/tests/pytest/core/test_admin.py index 1545306bb6..b8e6e86224 100644 --- a/tests/pytest/core/test_admin.py +++ b/tests/pytest/core/test_admin.py @@ -186,3 +186,17 @@ def test_EligibilityTypeForm_supports_expiration_True_zero_expiration_reenrollme # our custom validation message for when supports_expiration is True assert errors[0] == "When support_expiration is True, this value must be greater than 0." + + +@pytest.mark.django_db +@pytest.mark.parametrize("expiration_days", ["1", "14", "3000"], ids=lambda n: f"expiration_days ({n})") +@pytest.mark.parametrize( + "expiration_reenrollment_days", ["1", "14", "3000"], ids=lambda n: f"expiration_reenrollment_days ({n})" +) +def test_EligibilityTypeForm_supports_expiration_True_valid(expiration_days, expiration_reenrollment_days): + form_data = eligibility_type_form_data( + supports_expiration=True, expiration_days=expiration_days, expiration_reenrollment_days=expiration_reenrollment_days + ) + form = EligibilityTypeForm(form_data) + + assert form.is_valid()