Пример #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()
Пример #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()
Пример #3
0
def add_geodata(entity):
    if is_geo_coding_available():
        cache = get_geo_cache()
        geocoding.add_location(entity, cache=cache)
Пример #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
Пример #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