diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/register/tests/test_forms.py | 22 | ||||
-rw-r--r-- | ctrack/register/tests/test_models.py | 10 | ||||
-rw-r--r-- | ctrack/register/tests/test_views.py | 4 |
3 files changed, 18 insertions, 18 deletions
diff --git a/ctrack/register/tests/test_forms.py b/ctrack/register/tests/test_forms.py index e059cdf..5a055b6 100644 --- a/ctrack/register/tests/test_forms.py +++ b/ctrack/register/tests/test_forms.py @@ -15,7 +15,7 @@ def test_init(user, org_with_people): { "type_descriptor": "MEETING", # Must be Meeting as that is in the choices param "short_description": "Test short description", - "datetime": "2010-10-10T13:00", + "date": "2010-10-10T13:00", "comments": "Test Comments", "location": "Transient Moats", "participants": people_from_org @@ -33,7 +33,7 @@ def test_simple_event_limited_to_org_participants(user, org, person): { "type_descriptor": "PHONE_CALL", "short_description": "Test Short Description", - "datetime": "2010-10-10 10:00", + "date": "2010-10-10 10:00", "requested_response_date": "2020-12-24", "response_received_date": "2020-12-25", "participants": people_from_org, @@ -49,7 +49,7 @@ def test_cannot_create_disallowed_single_date_event_type_with_form(user, org_wit { "type_descriptor": "NOT ALLOWED EVENT", "short_description": "Test short description", - "datetime": "2020-10-10", + "date": "2020-10-10", "comments": "Test Comments", "participants": org_with_people.get_people() }, @@ -68,7 +68,7 @@ def test_create_simple_datetime_event(user, org_with_people): { "type_descriptor": "PHONE_CALL", "short_description": "Test Short Description", - "datetime": "2010-10-10 10:00", + "date": "2010-10-10 10:00", "requested_response_date": "2020-12-24", "response_received_date": "2020-12-25", "url": "https://fake.url.com", @@ -84,7 +84,7 @@ def test_response_date_cannot_be_before_date(user, org_with_people): { "type_descriptor": "PHONE_CALL", "short_description": "Test Short Description", - "datetime": "2010-10-10 10:00", + "date": "2010-10-10 10:00", "requested_response_date": "2009-12-24", "response_received_date": None, "comments": "Test Comments not needed", @@ -107,7 +107,7 @@ def test_meeting_blank_data(user, org_with_people): user=user, org_slug=None ) assert form.is_valid() is False - assert form.errors == {"datetime": ["This field is required."]} + assert form.errors == {"date": ["This field is required."]} def test_create_note(user, org_with_people): @@ -214,7 +214,7 @@ def test_caf_twin_date_event(user, caf): "type_descriptor": "CAF_PEER_REVIEW_PERIOD", "related_caf": caf, "short_description": "Test Description", - "start_date": "2009-10-01", + "date": "2009-10-01", "end_date": "2015-10-1", "comments": "Meaningless comments", }, @@ -230,7 +230,7 @@ def test_cannot_create_twin_date_event_for_caf_whose_end_date_is_open(allowed_ty "type_descriptor": allowed_type, "related_caf": caf, "short_description": "caf peer review for x company", - "start_date": "2020-10-10", + "date": "2020-10-10", "comments": "nice comments for this event", }, user=user, @@ -240,7 +240,7 @@ def test_cannot_create_twin_date_event_for_caf_whose_end_date_is_open(allowed_ty "type_descriptor": allowed_type, "related_caf": caf, "short_description": "caf peer review for x company", - "start_date": "2020-10-10", + "date": "2020-10-10", "comments": "nice comments for this event", }, user=user, @@ -249,7 +249,7 @@ def test_cannot_create_twin_date_event_for_caf_whose_end_date_is_open(allowed_ty e1.save() assert e2.is_valid() is False assert e2.errors == { - "start_date": ["You cannot have two CAF events starting on the same date."] + "date": ["You cannot have two CAF events starting on the same date."] } @@ -262,7 +262,7 @@ def test_cannot_create_twin_date_event_where_end_date_precedes_start(allowed_typ "type_descriptor": allowed_type, "related_caf": caf, "short_description": "caf peer review for x company", - "start_date": "2020-10-10", + "date": "2020-10-10", "end_date": "2020-10-09", "comments": "nice comments for this event", }, diff --git a/ctrack/register/tests/test_models.py b/ctrack/register/tests/test_models.py index aafd37f..1a89fd5 100644 --- a/ctrack/register/tests/test_models.py +++ b/ctrack/register/tests/test_models.py @@ -47,7 +47,7 @@ def test_caf_twin_date_events(allowed_type, user, caf): type_descriptor=allowed_type, related_caf=caf, short_description="CAF received for X Company", - start_date="2020-10-10", + date="2020-10-10", end_date="2020-10-25", comments="Nice comments for this event", user=user, @@ -64,7 +64,7 @@ def test_caf_twin_date_event_no_end_date(allowed_type, user, caf): type_descriptor=allowed_type, related_caf=caf, short_description="CAF received for X Company", - start_date="2020-10-10", + date="2020-10-10", comments="Nice comments for this event", user=user, ) @@ -173,7 +173,7 @@ def test_single_datetime_event(person, user, allowed_type): url="http://fake.url.com", requested_response_date="2021-01-24", response_received_date=None, - datetime="2020-10-10T15:00", + date="2020-10-10T15:00", comments="Comments on important event", # location is optional user=user, @@ -192,7 +192,7 @@ def test_cannot_create_twin_date_event_model_end_date_precedes_start(allowed_typ CAFTwinDateEvent.objects.create( type_descriptor=allowed_type, related_caf=caf, - start_date="2010-10-10", + date="2010-10-10", end_date="2010-01-01", short_description="Bobbins", user=user, @@ -205,7 +205,7 @@ def test_meeting_event(user, person): e = SingleDateTimeEvent.objects.create( type_descriptor="Meeting", short_description="Big Important Meeting", - datetime="2020-10-10T15:00", + date="2020-10-10T15:00", comments="Nice comments", location="Harvey's House", user=user, diff --git a/ctrack/register/tests/test_views.py b/ctrack/register/tests/test_views.py index 4e8152c..4158692 100644 --- a/ctrack/register/tests/test_views.py +++ b/ctrack/register/tests/test_views.py @@ -25,7 +25,7 @@ class TestSingleDateTimeEvent: expected_fields = [ "type_descriptor", "short_description", - "datetime", + "date", "comments", "location", ] @@ -47,7 +47,7 @@ class TestSingleDateTimeEvent: data = { "type_descriptor": "MEETING", "short_description": "Test Short Description", - "datetime": bad_date, + "date": bad_date, "comments": "Blah...", "location": "The Moon", } |