def check_geocoder(): """ Geocoder is relevant only when geocoding usage is enabled. """ if not is_geo_coding_available(): return {'status': 'pass'} return geocoding.get_health()
def check_geocache(): """ Geocache is relevant only when geocoding usage is enabled. """ if not is_geo_coding_available(): return {'status': 'pass'} cache = get_geo_cache() return cache.get_health()
def add_geodata(entity): if is_geo_coding_available(): cache = get_geo_cache() geocoding.add_location(entity, cache=cache)
def test_geo_caching_disabled(disable_redis): assert factory.is_geo_coding_available() is False assert factory.is_geo_cache_available() is False
def test_geo_caching_enabled(enable_geo_caching): assert factory.is_geo_coding_available() is True assert factory.is_geo_cache_available() is True