Don’t show scheduler when sending letters

This commit is contained in:
Chris Hill-Scott
2017-04-26 10:49:51 +01:00
parent 5352c81e99
commit dfbe330fa9
2 changed files with 31 additions and 1 deletions

View File

@@ -169,7 +169,7 @@
<form method="post" enctype="multipart/form-data" action="{{url_for('main.start_job', service_id=current_service.id, upload_id=upload_id)}}" class='page-footer'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="help" value="{{ '3' if help else 0 }}" />
{% if choose_time_form %}
{% if choose_time_form and template.template_type != 'letter' %}
{{ radio_select(
choose_time_form.scheduled_for,
wrapping_class='bottom-gutter-2-3'

View File

@@ -457,6 +457,36 @@ def test_test_message_can_only_be_sent_now(
assert 'name="scheduled_for"' not in content
def test_letter_can_only_be_sent_now(
logged_in_client,
mock_get_service,
mock_get_service_letter_template,
mock_s3_download,
mock_has_permissions,
mock_get_users_by_service,
mock_get_detailed_service_for_today,
fake_uuid,
):
with logged_in_client.session_transaction() as session:
session['upload_data'] = {
'original_file_name': 'Test message',
'template_id': fake_uuid,
'notification_count': 1,
'valid': True
}
response = logged_in_client.get(url_for(
'main.check_messages',
service_id=fake_uuid,
upload_id=fake_uuid,
template_type='letter',
from_test=True
))
content = response.get_data(as_text=True)
assert 'name="scheduled_for"' not in content
@pytest.mark.parametrize(
'when', [
'', '2016-08-25T13:04:21.767198'