diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-12 12:08:54 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-12 12:08:54 +0100 |
commit | 7db4392801aca82d1dec6eb57abf7cb74c10689c (patch) | |
tree | 3c6a5a565c0c5f7b76568e9c574b83fd0730e719 /ctrack/register/tests/test_event_models.py | |
parent | 392ed6017ab01250c1748bd0f2717d8db554115d (diff) |
more tests using parameterization
Diffstat (limited to '')
-rw-r--r-- | ctrack/register/tests/test_event_models.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ctrack/register/tests/test_event_models.py b/ctrack/register/tests/test_event_models.py index 702ca27..39b501c 100644 --- a/ctrack/register/tests/test_event_models.py +++ b/ctrack/register/tests/test_event_models.py @@ -20,6 +20,8 @@ pytestmark = pytest.mark.django_db "CAF_FEEDBACK_EMAILED_OES", "CAF_RECEIVED", "CAF_EMAILED_ROSA", + "CAF_VALIDATION_SIGN_OFF", + "CAF_VALIDATION_RECORD_EMAILED_TO_OES", ], ) def test_caf_single_date_events(allowed_type, user, caf): @@ -54,9 +56,12 @@ def test_caf_twin_date_events(allowed_type, user, caf): assert e.type_descriptor == allowed_type -def test_caf_twin_date_event_no_end_date(user, caf): +@pytest.mark.parametrize( + "allowed_type", ["CAF_PEER_REVIEW_PERIOD", "CAF_VALIDATION_PERIOD"] +) +def test_caf_twin_date_event_no_end_date(allowed_type, user, caf): e = CAFTwinDateEvent.objects.create( - type_descriptor="CAF_PEER_REVIEW_PERIOD", + type_descriptor=allowed_type, related_caf=caf, short_description="CAF received for X Company", start_date="2020-10-10", @@ -66,10 +71,13 @@ def test_caf_twin_date_event_no_end_date(user, caf): assert e.end_date is None -def test_caf_twin_date_event_no_start_date_not_allowed(user, caf): +@pytest.mark.parametrize( + "allowed_type", ["CAF_PEER_REVIEW_PERIOD", "CAF_VALIDATION_PERIOD"] +) +def test_caf_twin_date_event_no_start_date_not_allowed(allowed_type, user, caf): with pytest.raises(IntegrityError): CAFTwinDateEvent.objects.create( - type_descriptor="CAF_PEER_REVIEW_PERIOD", + type_descriptor=allowed_type, related_caf=caf, short_description="CAF received for X Company", end_date="2020-10-10", |