aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/tests/test_event_models.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-11 16:13:00 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-11 16:13:00 +0100
commit777372e75bc46fa60e68afcf185642ed38d57e5c (patch)
tree510aff77596a172ee4d28449c6ee15730142bc4e /ctrack/register/tests/test_event_models.py
parentf69d29b53b6273d1b1d72cbcce4195e42788d556 (diff)
fixed constraint for CAF event
Diffstat (limited to 'ctrack/register/tests/test_event_models.py')
-rw-r--r--ctrack/register/tests/test_event_models.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/ctrack/register/tests/test_event_models.py b/ctrack/register/tests/test_event_models.py
index 132f076..4d72d22 100644
--- a/ctrack/register/tests/test_event_models.py
+++ b/ctrack/register/tests/test_event_models.py
@@ -46,12 +46,46 @@ 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):
+ now = datetime.datetime.now()
+ e1 = 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,
+ )
+ e2 = CAFSingleDateEvent.objects.create(
+ type_descriptor="CAF_INITIAL_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 e1.created_date.day == now.day
+ assert e2.created_date.day == now.day
+
+
def test_event_type_enum():
assert EventType.MEETING.name == "MEETING"
assert EventType.PHONE_CALL.name == "PHONE_CALL"
assert EventType.VIDEO_CALL.name == "VIDEO_CALL"
assert EventType.CAF_INITIAL_CAF_RECEIVED.name == "CAF_INITIAL_CAF_RECEIVED"
- assert EventType.CAF_INITIAL_CAF_EMAILED_ROSA.name == "CAF_INITIAL_CAF_EMAILED_ROSA"
assert EventType.CAF_FEEDBACK_EMAILED_OES.name == "CAF_FEEDBACK_EMAILED_OES"
assert EventType.CAF_RECEIVED.name == "CAF_RECEIVED"
assert EventType.CAF_EMAILED_ROSA.name == "CAF_EMAILED_ROSA"