aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/register/tests')
-rw-r--r--ctrack/register/tests/test_event_models.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/ctrack/register/tests/test_event_models.py b/ctrack/register/tests/test_event_models.py
index 4c4d77c..678d8b5 100644
--- a/ctrack/register/tests/test_event_models.py
+++ b/ctrack/register/tests/test_event_models.py
@@ -7,6 +7,7 @@ from ctrack.register.models import (
EventType,
SingleDateTimeEvent,
CAFSingleDateEvent,
+ CAFTwinDateEvent,
)
pytestmark = pytest.mark.django_db
@@ -35,6 +36,24 @@ def test_caf_single_date_events(allowed_type, user, caf):
assert e.type_descriptor == allowed_type
+@pytest.mark.parametrize(
+ "allowed_type", ["CAF_PEER_REVIEW_PERIOD", "CAF_VALIDATION_PERIOD"]
+)
+def test_caf_twin_date_events(allowed_type, user, caf):
+ now = datetime.datetime.now()
+ e = CAFTwinDateEvent.objects.create(
+ type_descriptor=allowed_type,
+ related_caf=caf,
+ short_description="CAF received for X Company",
+ start_date="2020-10-10",
+ end_date="2020-10-25",
+ comments="Nice comments for this event",
+ 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):
CAFSingleDateEvent.objects.create(
type_descriptor="CAF_INITIAL_CAF_RECEIVED",