-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1772 from uktrade/close-query-form-wip
Close query form thing
- Loading branch information
Showing
6 changed files
with
138 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% extends 'layouts/two-pane.html' %} | ||
{% load crispy_forms_tags crispy_forms_gds %} | ||
|
||
{% block title %}{{title}}{% endblock %} | ||
{% block back_link %} | ||
<a href="{{ back_link_url }}" id="back-link" class="govuk-back-link">{{ back_link_text|default:"Back" }}</a> | ||
{% endblock %} | ||
|
||
{% block two_thirds %} | ||
|
||
{% if errors %} | ||
{% include "forms-errors.html" %} | ||
{% endif %} | ||
|
||
<form action="{{ form_action_url }}" method="post" enctype="multipart/form-data"> | ||
{% csrf_token %} | ||
|
||
{% error_summary form %} | ||
|
||
<div class="govuk-body"> | ||
<h1 class="govuk-label-wrapper"> | ||
<label class="govuk-label--l"> | ||
Close query | ||
</label> | ||
</h1> | ||
<div class=" govuk-!-padding-top-3 govuk-!-padding-bottom-3"> | ||
<div class="app-ecju-query__text"> | ||
{{ query.question }} | ||
</div> | ||
</div> | ||
{% crispy form %} | ||
</div> | ||
</form> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
|
||
|
||
from caseworker.cases.forms.queries import CloseQueryForm | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"data, is_valid, errors", | ||
( | ||
({}, False, {"reason_for_closing_query": ["Enter a reason why you are closing the query"]}), | ||
( | ||
{"reason_for_closing_query": ""}, | ||
False, | ||
{"reason_for_closing_query": ["Enter a reason why you are closing the query"]}, | ||
), | ||
({"reason_for_closing_query": "closing response"}, True, {}), | ||
), | ||
) | ||
def test_ecju_queries_close_query_form(data, is_valid, errors): | ||
form = CloseQueryForm(data=data) | ||
assert form.is_valid() == is_valid | ||
assert form.errors == errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters