def test_subscription_policy_describe(): """Test policy describe.""" from invenio_groups.api import SubscriptionPolicy assert SubscriptionPolicy.describe(SubscriptionPolicy.OPEN) assert SubscriptionPolicy.describe(SubscriptionPolicy.APPROVAL) assert SubscriptionPolicy.describe(SubscriptionPolicy.CLOSED) assert SubscriptionPolicy.describe("INVALID") is None
def test_subscription_policy_validate(): """Test policy validation.""" from invenio_groups.api import SubscriptionPolicy assert SubscriptionPolicy.validate(SubscriptionPolicy.OPEN) assert SubscriptionPolicy.validate(SubscriptionPolicy.APPROVAL) assert SubscriptionPolicy.validate(SubscriptionPolicy.CLOSED) assert not SubscriptionPolicy.validate("INVALID")