def returning_available(raise_exception=False):
    """
    Tests if returning query is available
    :return: boolean
    """
    try:
        from django_pg_returning import ReturningQuerySet
        return True
    except ImportError:
        if raise_exception:
            raise ImportError(
                'Returning feature requires django-pg-returning library installed. Use pip install django-pg-returning'
                )
        else:
            return False
