Esempio n. 1
0
def test_should_404_if_non_sms_template_for_tour_step(client_request,
                                                      fake_uuid, mocker,
                                                      template_type, method):
    mocker.patch(
        'app.service_api_client.get_service_template',
        return_value={'data': create_template(template_type=template_type)})

    getattr(client_request, method)('main.tour_step',
                                    service_id=SERVICE_ONE_ID,
                                    template_id=fake_uuid,
                                    step_index=1,
                                    _expected_status=404)
Esempio n. 2
0
def test_should_404_if_non_sms_template_for_tour_start(
    client_request,
    fake_uuid,
    mocker,
    template_type,
):
    mocker.patch(
        'app.service_api_client.get_service_template',
        return_value={'data': create_template(template_type=template_type)})

    client_request.get(
        'main.begin_tour',
        service_id=SERVICE_ONE_ID,
        template_id=fake_uuid,
        _expected_status=404,
    )
Esempio n. 3
0
def test_should_show_letter_job_with_first_class_if_no_notifications(
        client_request, service_one, mock_get_letter_job, fake_uuid,
        mock_get_notifications_with_no_notifications,
        mock_get_service_data_retention, mocker):
    mocker.patch('app.service_api_client.get_service_template',
                 return_value={
                     'data':
                     create_template(template_type='letter', postage='first')
                 })

    page = client_request.get(
        'main.view_job',
        service_id=SERVICE_ONE_ID,
        job_id=fake_uuid,
    )

    assert normalize_spaces(page.select('.keyline-block')
                            [1].text) == '5 January Estimated delivery date'