def test_privacy_policy_describe(): """Test policy describe.""" from invenio_groups.api import PrivacyPolicy assert PrivacyPolicy.describe(PrivacyPolicy.PUBLIC) assert PrivacyPolicy.describe(PrivacyPolicy.MEMBERS) assert PrivacyPolicy.describe(PrivacyPolicy.ADMINS) assert PrivacyPolicy.describe("INVALID") is None
def test_privacy_policy_validate(): """Test policy validation.""" from invenio_groups.api import PrivacyPolicy assert PrivacyPolicy.validate(PrivacyPolicy.PUBLIC) assert PrivacyPolicy.validate(PrivacyPolicy.MEMBERS) assert PrivacyPolicy.validate(PrivacyPolicy.ADMINS) assert not PrivacyPolicy.validate("INVALID")