def METHOD_NAME(svc_client_with_templates):
    """Setup and teardown steps for templates tests."""
    from renku.core.util import requests
    svc_client, authentication_headers, template = svc_client_with_templates
    parameters = []
    for parameter in template["metadata"].keys():
        parameters.append({"key": parameter, "value": template["metadata"][parameter]})
    payload = {
        **template,
        "identifier": template["id"],
        "parameters": parameters,
        "project_name": f"Test renku-core {uuid.uuid4().hex[:12]}",
        "project_namespace": "renku-python-integration-tests",
        "project_repository": "https://gitlab.dev.renku.ch",
        "project_description": "new service project",
        "project_custom_metadata": {
            "@id": "http://example.com/metadata12",
            "@type": "https://schema.org/myType",
            "https://schema.org/property1": 1,
            "https://schema.org/property2": "test",
        },
    }
    # cleanup by invoking the GitLab delete API
    # TODO: consider using the project delete endpoint once implemented
    def remove_project():
        project_slug = "{}/{}".format(payload["project_namespace"], normalize_to_ascii(payload["project_name"]))
        project_slug_encoded = urllib.parse.quote(project_slug, safe="")
        project_delete_url = "{}/api/v4/projects/{}".format(payload["project_repository"], project_slug_encoded)
        requests.delete(url=project_delete_url, headers=authentication_headers)
        return True
    yield svc_client, authentication_headers, payload, remove_project
    remove_project()