def METHOD_NAME(
    api_client,
    units,
    streets,
    services,
    service_nodes,
    addresses,
    administrative_division,
    accessibility_shortcoming,
    municipality,
):
    # Search for "museo" in entities: units,services and servicenods
    url = reverse("search") + "?q=museo&type=unit,service,servicenode"
    response = api_client.get(url)
    assert response.status_code == 200
    results = response.json()["results"]
    # Should find one Unit, one Service and one ServiceNode
    assert len(results) == 3
    # Test that all Unit fields are serialized
    biological_museum_unit = results[0]
    assert biological_museum_unit["object_type"] == "unit"
    assert biological_museum_unit["name"]["fi"] == "Biologinen museo"
    assert biological_museum_unit["name"]["sv"] == "Biologiska museet"
    assert biological_museum_unit["name"]["en"] == "Biological Museum"
    assert biological_museum_unit["street_address"]["fi"] == "Neitsytpolku 1"
    assert biological_museum_unit["municipality"] == "helsinki"
    assert biological_museum_unit["contract_type"]["id"] == "municipal_service"
    assert (
        biological_museum_unit["contract_type"]["description"]["fi"]
        == "kunnallinen palvelu"
    )
    assert (
        biological_museum_unit["contract_type"]["description"]["sv"]
        == "kommunal tjänst"
    )
    assert (
        biological_museum_unit["contract_type"]["description"]["en"]
        == "municipal service"
    )
    assert biological_museum_unit["department"]["name"]["fi"] == "Test Department"
    assert (
        biological_museum_unit["department"]["street_address"]["fi"]
        == "Test Address 42"
    )
    assert biological_museum_unit["department"]["municipality"] == "helsinki"
    assert biological_museum_unit["accessibility_shortcoming_count"]["rollator"] == 5
    assert biological_museum_unit["accessibility_shortcoming_count"]["stroller"] == 1
    assert biological_museum_unit["location"]["type"] == "Point"
    assert biological_museum_unit["location"]["coordinates"][0] == 22.24
    assert biological_museum_unit["location"]["coordinates"][1] == 60.44
    # Test Service fields.
    museum_service = results[1]
    assert museum_service
    assert museum_service["object_type"] == "service"
    assert museum_service["name"]["fi"] == "Museot"
    assert museum_service["name"]["sv"] == "Museum"
    assert museum_service["name"]["en"] == "Museum"
    assert museum_service["unit_count"]["municipality"]["helsinki"] == 1
    assert museum_service["unit_count"]["total"] == 1
    assert museum_service["root_service_node"]["name"]["fi"] == "Vapaa-aika"
    assert museum_service["root_service_node"]["name"]["sv"] == "Fritid"
    assert museum_service["root_service_node"]["name"]["en"] == "Leisure"
    # Test ServiceNode fields
    museum_service_node = results[2]
    assert museum_service_node["object_type"] == "servicenode"
    assert museum_service_node["ids"] == ["2"]
    assert museum_service_node["name"]["fi"] == "Museot"
    assert museum_service_node["name"]["sv"] == "Museer"
    assert museum_service_node["name"]["en"] == "Museums"
    assert museum_service_node["root_service_node"]["name"]["fi"] == "Vapaa-aika"
    assert museum_service_node["root_service_node"]["name"]["sv"] == "Fritid"
    assert museum_service_node["root_service_node"]["name"]["en"] == "Leisure"
    assert museum_service_node["unit_count"]["municipality"]["helsinki"] == 1
    assert museum_service_node["unit_count"]["total"] == 1
    # Test that unit "Impivaara" is retrieved from service Uimahalli
    url = reverse("search") + "?q=uimahalli&type=unit&rank_threshold=0"
    response = api_client.get(url)
    results = response.json()["results"]
    assert results[0]["name"]["fi"] == "Impivaara"
    assert results[0]["object_type"] == "unit"
    # Test syllables and include parameter by searching "asema"
    url = reverse("search") + "?q=asema&type=unit&include=unit.www,unit.phone"
    response = api_client.get(url)
    results = response.json()["results"]
    assert len(results) == 1
    assert results[0]["object_type"] == "unit"
    assert results[0]["name"]["fi"] == "Terveysasema"
    assert results[0]["www"] == "www.test.com"
    assert results[0]["phone"] == "02020242"
    # Test municipality parameter.
    url = reverse("search") + "?q=museo&type=unit&municipality=raisio"
    response = api_client.get(url)
    results = response.json()["results"]
    # No results for municipality "Raisio".
    assert len(results) == 0
    # Test address search and serialization.
    url = reverse("search") + "?q=kurra&type=address"
    response = api_client.get(url)
    results = response.json()["results"]
    assert len(results) == 1
    kurrapolku = results[0]
    assert kurrapolku["object_type"] == "address"
    assert kurrapolku["name"]["fi"] == "Kurrapolku 1A"
    assert kurrapolku["name"]["sv"] == "Kurrastigen 1A"
    assert kurrapolku["name"]["en"] == "Kurrapolku 1A"
    assert kurrapolku["number"] == "1"
    assert kurrapolku["number_end"] == "2"
    assert kurrapolku["letter"] == "A"
    assert kurrapolku["municipality"]["id"] == "helsinki"
    assert kurrapolku["municipality"]["name"]["fi"] == "Helsinki"
    assert kurrapolku["municipality"]["name"]["sv"] == "Helsingfors"
    assert kurrapolku["street"]["name"]["fi"] == "Kurrapolku"
    assert kurrapolku["street"]["name"]["sv"] == "Kurrastigen"
    assert kurrapolku["location"]["type"] == "Point"
    assert kurrapolku["location"]["coordinates"][0] == 60.479032
    assert kurrapolku["location"]["coordinates"][1] == 22.25417
    # Test that addresses are sorted by naturalsort.
    url = reverse("search") + "?q=yliopistonkatu&type=address"
    response = api_client.get(url)
    results = response.json()["results"]
    assert results[0]["name"]["fi"] == "Yliopistonkatu 5"
    assert results[1]["name"]["fi"] == "Yliopistonkatu 21"
    assert results[2]["name"]["fi"] == "Yliopistonkatu 33"
    # Test administrative division search.
    url = reverse("search") + "?q=hel&type=administrativedivision"
    response = api_client.get(url)
    results = response.json()["results"]
    assert results[0]["object_type"] == "administrativedivision"
    assert results[0]["name"]["fi"] == "Helsinki"