diff options
Diffstat (limited to 'ctrack/register/tests')
-rw-r--r-- | ctrack/register/tests/test_event_models.py | 12 | ||||
-rw-r--r-- | ctrack/register/tests/test_forms.py | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/ctrack/register/tests/test_event_models.py b/ctrack/register/tests/test_event_models.py index 39b501c..61a541c 100644 --- a/ctrack/register/tests/test_event_models.py +++ b/ctrack/register/tests/test_event_models.py @@ -180,6 +180,18 @@ def test_single_datetime_event(person, user, allowed_type): assert event.created_date.day == now.day +def test_cannot_create_twin_date_event_model_end_date_precedes_start(user, caf): + with pytest.raises(IntegrityError): + CAFTwinDateEvent.objects.create( + type_descriptor="CAF_PEER_REVIEW_PERIOD", + related_caf=caf, + start_date="2010-10-10", + end_date="2010-01-01", + short_description="Bobbins", + user=user + ) + + def test_meeting_event(user, person): uname = user.name now = datetime.datetime.now() diff --git a/ctrack/register/tests/test_forms.py b/ctrack/register/tests/test_forms.py index 401ed2f..49cd5b4 100644 --- a/ctrack/register/tests/test_forms.py +++ b/ctrack/register/tests/test_forms.py @@ -20,7 +20,7 @@ def test_init(user): "short_description": "Test short description", "datetime": "2010-10-10T13:00", "comments": "Test Comments", - "location": "Transient Moabs", + "location": "Transient Moats", }, user=user, ) @@ -188,7 +188,7 @@ def test_cannot_create_twin_date_event_for_caf_whose_end_date_is_open(allowed_ty @pytest.mark.parametrize("allowed_type", ["CAF_PEER_REVIEW_PERIOD", "CAF_VALIDATION_PERIOD"]) def test_cannot_create_twin_date_event_where_end_date_precedes_start(allowed_type, user, caf): - "This one is done with a database integrity check instead of a form validation" + """This one is done with a database integrity check instead of a form validation""" with pytest.raises(IntegrityError): CAFTwinDateEventForm( { |