-
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.
- Loading branch information
1 parent
a737dee
commit f1ad403
Showing
5 changed files
with
114 additions
and
59 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 |
---|---|---|
@@ -1,57 +1,65 @@ | ||
<div class="govuk-form-group"> | ||
<div class="govuk-date-input" id="date_of_issue"> | ||
<div class="govuk-date-input__item"> | ||
|
||
<div class="govuk-form-group"> | ||
<label class="govuk-label govuk-date-input__label {% if component.inline_title %}govuk-visually-hidden{% endif %}" for="{{ component.prefix }}day"> | ||
Day | ||
</label> | ||
<input class="govuk-input govuk-date-input__input govuk-input--width-2 | ||
{% if component.prefix in errors or component.prefix|add:component.name in errors%} | ||
govuk-input--error | ||
{% endif %}" | ||
id="{{ component.prefix }}day" | ||
name="{{ component.prefix }}day" | ||
type="number" | ||
value="{{ data.day }}" | ||
{% if component.inline_title %}placeholder="Day {{component.suffix}}"{% endif %} | ||
|
||
/> | ||
</div> | ||
</div> | ||
<div class="govuk-date-input__item"> | ||
<div class="govuk-form-group"> | ||
<label class="govuk-label govuk-date-input__label {% if component.inline_title %}govuk-visually-hidden{% endif %}" for="{{ component.prefix }}month"> | ||
Month | ||
</label> | ||
<fieldset class="govuk-fieldset" role="group" aria-describedby="date_of_issue-hint"> | ||
<legend class="govuk-fieldset__legend govuk-fieldset__legend–l"> | ||
<h1 class="govuk-fieldset__heading"> | ||
{{ component.title }} | ||
</h1> | ||
</legend> | ||
<div id="return-date-hint" class="govuk-hint"> | ||
{{ component.description }} | ||
</div> | ||
<div class="govuk-date-input" id="return-date"> | ||
<div class="govuk-date-input__item"> | ||
<div class="govuk-form-group"> | ||
<label class="govuk-label govuk-date-input__label {% if component.inline_title %}govuk-visually-hidden{% endif %}" for="{{ component.prefix }}day"> | ||
Day | ||
</label> | ||
<input class="govuk-input govuk-date-input__input govuk-input--width-2 | ||
{% if component.prefix in errors or component.prefix|add:component.name in errors%} | ||
govuk-input--error | ||
{% endif %}" | ||
id="{{ component.prefix }}month" | ||
name="{{ component.prefix }}month" | ||
type="number" | ||
value="{{ data.month }}" | ||
{% if component.inline_title %}placeholder="Month {{component.suffix}}"{% endif %} | ||
/> | ||
</div> | ||
</div> | ||
<div class="govuk-date-input__item"> | ||
<div class="govuk-form-group"> | ||
<label class="govuk-label govuk-date-input__label {% if component.inline_title %}govuk-visually-hidden{% endif %}" for="{{ component.prefix }}year"> | ||
Year | ||
</label> | ||
<input class="govuk-input govuk-date-input__input govuk-input--width-3 | ||
{% if component.prefix in errors or component.prefix|add:component.name in errors%} | ||
govuk-input--error | ||
{% endif %}" | ||
id="{{ component.prefix }}year" | ||
name="{{ component.prefix }}year" | ||
type="number" | ||
value="{{ data.year }}" | ||
{% if component.inline_title %}placeholder="Year {{component.suffix}}"{% endif %} | ||
{% if component.prefix in errors or component.prefix|add:component.name in errors%} | ||
govuk-input--error | ||
{% endif %}" | ||
id="{{ component.prefix }}day" | ||
name="{{ component.prefix }}day" | ||
type="text" | ||
inputmode="numeric" | ||
value="{{ data.day }}" | ||
{% if component.inline_title %}placeholder="Day {{component.suffix}}"{% endif %} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="govuk-date-input__item"> | ||
<div class="govuk-form-group"> | ||
<label class="govuk-label govuk-date-input__label {% if component.inline_title %}govuk-visually-hidden{% endif %}" for="{{ component.prefix }}month"> | ||
Month | ||
</label> | ||
<input class="govuk-input govuk-date-input__input govuk-input--width-2 | ||
{% if component.prefix in errors or component.prefix|add:component.name in errors%} | ||
govuk-input--error | ||
{% endif %}" | ||
id="{{ component.prefix }}month" | ||
name="{{ component.prefix }}month" | ||
type="text" | ||
inputmode="numeric" | ||
value="{{ data.month }}" | ||
{% if component.inline_title %}placeholder="Month {{component.suffix}}"{% endif %} | ||
/> | ||
</div> | ||
</div> | ||
<div class="govuk-date-input__item"> | ||
<div class="govuk-form-group"> | ||
<label class="govuk-label govuk-date-input__label {% if component.inline_title %}govuk-visually-hidden{% endif %}" for="{{ component.prefix }}year"> | ||
Year | ||
</label> | ||
<input class="govuk-input govuk-date-input__input govuk-input--width-3 | ||
{% if component.prefix in errors or component.prefix|add:component.name in errors%} | ||
govuk-input--error | ||
{% endif %}" | ||
id="{{ component.prefix }}year" | ||
name="{{ component.prefix }}year" | ||
inputmode="numeric" | ||
type="text" | ||
value="{{ data.year }}" | ||
{% if component.inline_title %}placeholder="Year {{component.suffix}}"{% endif %} | ||
/> | ||
</div> | ||
</div> | ||
</fieldset> |
47 changes: 47 additions & 0 deletions
47
unit_tests/exporter/applications/views/test_exporter_details.py
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,47 @@ | ||
import pytest | ||
|
||
from django.urls import reverse | ||
|
||
|
||
@pytest.fixture | ||
def application_pk(data_standard_case): | ||
return data_standard_case["case"]["data"]["id"] | ||
|
||
|
||
@pytest.fixture | ||
def application_export_details_url(application_pk): | ||
return reverse( | ||
"applications:export_details", | ||
kwargs={ | ||
"pk": application_pk, | ||
}, | ||
) | ||
|
||
|
||
def test_application_export_details_return_date( | ||
authorized_client, | ||
mock_application_get, | ||
application_export_details_url, | ||
requests_mock, | ||
application_pk, | ||
beautiful_soup, | ||
): | ||
|
||
requests_mock.put( | ||
f"/applications/{application_pk}/temporary-export-details/", | ||
json={}, | ||
) | ||
|
||
response = authorized_client.post( | ||
application_export_details_url, | ||
data={ | ||
"_action": "submit", | ||
"goods_starting_point": "GB", | ||
"export_type": "temporary", | ||
"form_pk": "3", | ||
}, | ||
) | ||
|
||
soup = beautiful_soup(response.content) | ||
assert soup.find("legend").label.text.strip() == "Proposed date the products will return to the UK" | ||
assert "For example, 12 11" in soup.find(id="return-date-hint").text.strip() |