diff --git a/tests/app/v2/template/test_get_template.py b/tests/app/v2/template/test_get_template.py index 6dcf5454e..ef3c9f437 100644 --- a/tests/app/v2/template/test_get_template.py +++ b/tests/app/v2/template/test_get_template.py @@ -41,12 +41,10 @@ def test_get_email_template_by_id_returns_200(client, sample_service, tmp_type, assert json_response == expected_response -def test_get_template_with_non_existent_template_id_returns_404(client, sample_service): +def test_get_template_with_non_existent_template_id_returns_404(client, fake_uuid, sample_service): auth_header = create_authorization_header(service_id=sample_service.id) - random_template_id = str(uuid.uuid4()) - - response = client.get(path='/v2/template/{}'.format(random_template_id), + response = client.get(path='/v2/template/{}'.format(fake_uuid), headers=[('Content-Type', 'application/json'), auth_header]) assert response.status_code == 404 diff --git a/tests/app/v2/template/test_post_template.py b/tests/app/v2/template/test_post_template.py index e0b84f468..0d2b70ccb 100644 --- a/tests/app/v2/template/test_post_template.py +++ b/tests/app/v2/template/test_post_template.py @@ -57,13 +57,11 @@ def test_invalid_post_template_returns_400(client, sample_service, tmp_type): assert 'Missing personalisation: Missing' in resp_json['errors'][0]['message'] -def test_post_template_with_non_existent_template_id_returns_404(client, sample_service): +def test_post_template_with_non_existent_template_id_returns_404(client, fake_uuid, sample_service): auth_header = create_authorization_header(service_id=sample_service.id) - random_template_id = str(uuid.uuid4()) - response = client.post( - path='/v2/template/{}/preview'.format(random_template_id), + path='/v2/template/{}/preview'.format(fake_uuid), data=json.dumps(valid_data), headers=[('Content-Type', 'application/json'), auth_header])