Example #1
0
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()
Example #2
0
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()
Example #3
0
def add_geodata(entity):
    if is_geo_coding_available():
        cache = get_geo_cache()
        geocoding.add_location(entity, cache=cache)
Example #4
0
def test_geo_caching_disabled(disable_redis):
    assert factory.is_geo_coding_available() is False
    assert factory.is_geo_cache_available() is False
Example #5
0
def test_geo_caching_enabled(enable_geo_caching):
    assert factory.is_geo_coding_available() is True
    assert factory.is_geo_cache_available() is True