3375 |
3375 |
assert urlopen.call_args[0][0] == 'https://nominatim.entrouvert.org/search?format=json&q=test&accept-language=en'
|
3376 |
3376 |
|
3377 |
3377 |
pub.site_options.add_section('options')
|
|
3378 |
pub.site_options.set('options', 'map-bounds-top-left', '1.23;2.34')
|
|
3379 |
pub.site_options.set('options', 'map-bounds-bottom-right', '2.34;3.45')
|
|
3380 |
pub.site_options.write(open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w'))
|
|
3381 |
resp = get_app(pub).get('/api/geocoding?q=test')
|
|
3382 |
assert urlopen.call_args[0][0] == ('https://nominatim.entrouvert.org/search?viewbox=2.34,1.23,3.45,2.34&bounded=1&'
|
|
3383 |
'format=json&q=test&accept-language=en')
|
|
3384 |
|
3378 |
3385 |
pub.site_options.set('options', 'nominatim_key', 'KEY')
|
|
3386 |
pub.site_options.set('options', 'map-bounds-top-left', '')
|
|
3387 |
pub.site_options.set('options', 'map-bounds-bottom-right', '')
|
3379 |
3388 |
pub.site_options.write(open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w'))
|
3380 |
3389 |
resp = get_app(pub).get('/api/geocoding?q=test')
|
3381 |
3390 |
assert urlopen.call_args[0][0] == 'https://nominatim.entrouvert.org/search?key=KEY&format=json&q=test&accept-language=en'
|
3382 |
3391 |
|
|
3392 |
pub.site_options.set('options', 'map-bounds-top-left', '1.23;2.34')
|
|
3393 |
pub.site_options.set('options', 'map-bounds-bottom-right', '2.34;3.45')
|
|
3394 |
pub.site_options.write(open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w'))
|
|
3395 |
resp = get_app(pub).get('/api/geocoding?q=test')
|
|
3396 |
assert urlopen.call_args[0][0] == ('https://nominatim.entrouvert.org/search?key=KEY&viewbox=2.34,1.23,3.45,2.34&bounded=1&'
|
|
3397 |
'format=json&q=test&accept-language=en')
|
|
3398 |
|
3383 |
3399 |
pub.site_options.set('options', 'geocoding_service_url', 'http://reverse.example.net/?param=value')
|
3384 |
3400 |
pub.site_options.write(open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w'))
|
3385 |
3401 |
resp = get_app(pub).get('/api/geocoding?q=test')
|