mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 10:57:58 +00:00
make localisation of results explicit
Localisation was previously done as part of the formatting but might also be useful on its own when working with the results directly.
This commit is contained in:
@@ -75,11 +75,14 @@ def test_search_details_minimal():
|
||||
{'category': 'place',
|
||||
'type': 'thing',
|
||||
'admin_level': 15,
|
||||
'names': {},
|
||||
'localname': '',
|
||||
'calculated_importance': pytest.approx(0.0000001),
|
||||
'rank_address': 30,
|
||||
'rank_search': 30,
|
||||
'isarea': False,
|
||||
'addresstags': {},
|
||||
'extratags': {},
|
||||
'centroid': {'type': 'Point', 'coordinates': [1.0, 2.0]},
|
||||
'geometry': {'type': 'Point', 'coordinates': [1.0, 2.0]},
|
||||
}
|
||||
@@ -108,6 +111,7 @@ def test_search_details_full():
|
||||
country_code='ll',
|
||||
indexed_date = import_date
|
||||
)
|
||||
search.localize(napi.Locales())
|
||||
|
||||
result = api_impl.format_result(search, 'json', {})
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ def test_format_reverse_with_address(fmt):
|
||||
rank_address=10,
|
||||
distance=0.0)
|
||||
]))
|
||||
reverse.localize(napi.Locales())
|
||||
|
||||
raw = api_impl.format_result(napi.ReverseResults([reverse]), fmt,
|
||||
{'addressdetails': True})
|
||||
@@ -164,6 +165,8 @@ def test_format_reverse_geocodejson_special_parts():
|
||||
distance=0.0)
|
||||
]))
|
||||
|
||||
reverse.localize(napi.Locales())
|
||||
|
||||
raw = api_impl.format_result(napi.ReverseResults([reverse]), 'geocodejson',
|
||||
{'addressdetails': True})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user