def METHOD_NAME(client, sample_service, tmp_type):
    templates = [
        create_template(
            sample_service,
            template_type=tmp_type,
            template_name="Template {}".format(i),
            subject="subject_{}".format(i) if tmp_type == EMAIL_TYPE else "",
        )
        for i in range(3)
    ]
    auth_header = create_authorization_header(service_id=sample_service.id)
    response = client.get(
        path="/v2/templates?type={}".format(tmp_type),
        headers=[("Content-Type", "application/json"), auth_header],
    )
    assert response.status_code == 200
    assert response.headers["Content-type"] == "application/json"
    json_response = json.loads(response.get_data(as_text=True))
    assert len(json_response["templates"]) == len(templates)
    for index, template in enumerate(json_response["templates"]):
        assert template["id"] == str(templates[index].id)
        assert template["body"] == templates[index].content
        assert template["type"] == tmp_type
        if templates[index].template_type == EMAIL_TYPE:
            assert template["subject"] == templates[index].subject