Skip to content

Commit 9e8dc94

Browse files
committed
test(models): magic method __str__
1 parent fff3387 commit 9e8dc94

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/pytest/core/test_models.py

+25
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
from benefits.core.models import EligibilityType, EligibilityVerifier, TransitAgency
44

55

6+
@pytest.mark.django_db
7+
def test_PemData_str(model_PemData):
8+
assert str(model_PemData) == model_PemData.label
9+
10+
11+
@pytest.mark.django_db
12+
def test_EligibilityType_str(model_EligibilityType):
13+
assert str(model_EligibilityType) == model_EligibilityType.label
14+
15+
616
@pytest.mark.django_db
717
def test_EligibilityType_get_matching(model_EligibilityType):
818
eligibility = EligibilityType.get(model_EligibilityType.id)
@@ -44,6 +54,11 @@ def test_EligibilityType_get_many_somematching(model_EligibilityType):
4454
assert model_EligibilityType in result
4555

4656

57+
@pytest.mark.django_db
58+
def test_EligibilityVerifier_str(model_EligibilityVerifier):
59+
assert str(model_EligibilityVerifier) == model_EligibilityVerifier.name
60+
61+
4762
@pytest.mark.django_db
4863
def test_EligibilityVerifier_by_id_matching(model_EligibilityVerifier):
4964
verifier = EligibilityVerifier.by_id(model_EligibilityVerifier.id)
@@ -85,6 +100,16 @@ def test_EligibilityVerifier_without_AuthProvider(model_EligibilityVerifier):
85100
assert not model_EligibilityVerifier.uses_auth_verification
86101

87102

103+
@pytest.mark.django_db
104+
def test_PaymentProcessor_str(model_PaymentProcessor):
105+
assert str(model_PaymentProcessor) == model_PaymentProcessor.name
106+
107+
108+
@pytest.mark.django_db
109+
def test_TransitAgency_str(model_TransitAgency):
110+
assert str(model_TransitAgency) == model_TransitAgency.long_name
111+
112+
88113
@pytest.mark.django_db
89114
def test_TransitAgency_get_type_id_matching(model_TransitAgency):
90115
eligibility = model_TransitAgency.eligibility_types.first()

0 commit comments

Comments
 (0)