diff options
-rw-r--r-- | ctrack/register/models.py | 1 | ||||
-rw-r--r-- | ctrack/register/tests/test_event_models.py | 27 | ||||
-rw-r--r-- | ctrack/register/tests/test_forms.py | 7 |
3 files changed, 17 insertions, 18 deletions
diff --git a/ctrack/register/models.py b/ctrack/register/models.py index d421efb..549f77d 100644 --- a/ctrack/register/models.py +++ b/ctrack/register/models.py @@ -125,6 +125,7 @@ class SingleDateTimeEvent(EventBase, ThirdPartyEventMixin, SingleDateTimeEventMi class CAFSingleDateEvent(EventBase, CAFMixin, SingleDateMixin): AVAILABLE_TYPES = [ (EventType.CAF_INITIAL_CAF_RECEIVED.name, "CAF - Initial CAF Received"), + (EventType.CAF_FEEDBACK_EMAILED_OES.name, "CAF - Emailed to OES"), (EventType.CAF_RECEIVED.name, "CAF - Received"), (EventType.CAF_EMAILED_ROSA.name, "CAF - Emailed to Rosa"), ] diff --git a/ctrack/register/tests/test_event_models.py b/ctrack/register/tests/test_event_models.py index b4e133e..4c4d77c 100644 --- a/ctrack/register/tests/test_event_models.py +++ b/ctrack/register/tests/test_event_models.py @@ -12,10 +12,19 @@ from ctrack.register.models import ( pytestmark = pytest.mark.django_db -def test_caf_initial_caf_received(user, caf): +@pytest.mark.parametrize( + "allowed_type", + [ + "CAF_INITIAL_CAF_RECEIVED", + "CAF_FEEDBACK_EMAILED_OES", + "CAF_RECEIVED", + "CAF_EMAILED_ROSA", + ], +) +def test_caf_single_date_events(allowed_type, user, caf): now = datetime.datetime.now() e = CAFSingleDateEvent.objects.create( - type_descriptor="CAF_INITIAL_CAF_RECEIVED", + type_descriptor=allowed_type, related_caf=caf, short_description="CAF received for X Company", date="2020-10-10", @@ -23,6 +32,7 @@ def test_caf_initial_caf_received(user, caf): user=user, ) assert e.created_date.day == now.day + assert e.type_descriptor == allowed_type def test_cannot_add_two_caf_initial_caf_received_events_on_same_date(user, caf): @@ -45,19 +55,6 @@ def test_cannot_add_two_caf_initial_caf_received_events_on_same_date(user, caf): ) -def test_caf_initial_caf_emailed_rosa(user, caf): - now = datetime.datetime.now() - e = CAFSingleDateEvent.objects.create( - type_descriptor="CAF_EMAILED_ROSA", - related_caf=caf, - short_description="CAF sent to Rosa for X Company", - date="2020-10-10", - comments="Nice comments for this event", - user=user, - ) - assert e.created_date.day == now.day - - def test_can_email_two_caf_on_same_date(user, caf): CAFSingleDateEvent.objects.create( type_descriptor="CAF_EMAILED_ROSA", diff --git a/ctrack/register/tests/test_forms.py b/ctrack/register/tests/test_forms.py index 572b8f8..7bb12a5 100644 --- a/ctrack/register/tests/test_forms.py +++ b/ctrack/register/tests/test_forms.py @@ -62,9 +62,10 @@ def test_meeting_blank_data(user): @pytest.mark.parametrize( "allowed_type", [ - ("CAF_INITIAL_CAF_RECEIVED"), - ("CAF_RECEIVED"), - ("CAF_EMAILED_ROSA"), + "CAF_INITIAL_CAF_RECEIVED", + "CAF_RECEIVED", + "CAF_FEEDBACK_EMAILED_OES", + "CAF_EMAILED_ROSA", ], ) def test_allowable_caf_single_date_event_forms(allowed_type, user, caf): |