From 1c7d45e92f83263a202d2f72c9daac61d34619cd Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 16 Oct 2024 17:23:14 +0100 Subject: wip: create assessment form --- engagements/tests/test_forms.py | 12 +++++++++++- engagements/tests/test_views.py | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'engagements/tests') diff --git a/engagements/tests/test_forms.py b/engagements/tests/test_forms.py index deb0a29..436be34 100644 --- a/engagements/tests/test_forms.py +++ b/engagements/tests/test_forms.py @@ -1,7 +1,12 @@ import pytest from django.forms import DateInput, Select, SelectMultiple -from engagements.forms import EngagementCreateForm, EngagementEffortCreateForm, EngagementStrategyCreateForm +from engagements.forms import ( + EngagementCreateForm, + EngagementEffortCreateForm, + EngagementStrategyCreateForm, + AssessmentCreateForm, +) from engagements.models import EngagementType, RegulatoryCycle pytestmark = pytest.mark.django_db @@ -129,3 +134,8 @@ def test_create_engagement_strategy_form(org, user, regulatory_cycles): } form = EngagementStrategyCreateForm(data=form_data) assert form.is_valid() + + +def test_create_assessment_engagement_type_form(): + e_type = EngagementType(name="ASSESSMENT") + form = AssessmentCreateForm({"initial": e_type}) diff --git a/engagements/tests/test_views.py b/engagements/tests/test_views.py index a7a420b..ef64f5e 100644 --- a/engagements/tests/test_views.py +++ b/engagements/tests/test_views.py @@ -140,3 +140,9 @@ def test_org_list_page_exists(client): url = reverse("engagements:org_detail") response = client.get(url) assert response.status_code == 302 + + +def test_assessment_create_form_view(client): + url = reverse("engagements:create_assessment") + response = client.get(url) + assert response.status_code == 302 -- cgit v1.2.3