From 773d6f970f72c4a975ec53810d898d1547e110b0 Mon Sep 17 00:00:00 2001 From: Dan Korostelev Date: Sun, 15 Mar 2009 00:51:22 +0000 Subject: Ensure that simple zope.schema's VocabularyRegistry is used for PermissionVocabulary tests to make them work in the KGS testing environment. --- CHANGES.txt | 5 ++++- src/zope/security/permission.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 6a7a608..23d3d70 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,7 +5,10 @@ CHANGES 3.6.3 (unreleased) ------------------ -- ... +- Ensure that simple zope.schema's VocabularyRegistry is used for + PermissionVocabulary tests, because it's replaced implicitly in + environments with zope.app.schema installed that makes that tests + fail. 3.6.2 (2009-03-14) ------------------ diff --git a/src/zope/security/permission.py b/src/zope/security/permission.py index 8329e4c..6145a16 100644 --- a/src/zope/security/permission.py +++ b/src/zope/security/permission.py @@ -75,7 +75,10 @@ def PermissionsVocabulary(context=None): Term values are permissions, while term tokens are permission IDs. - To illustrate, we need to register the permission IDs vocab: + To illustrate, we need to register the permission IDs vocabulary: + + >>> from zope.schema.vocabulary import _clear + >>> _clear() >>> from zope.schema.vocabulary import getVocabularyRegistry >>> registry = getVocabularyRegistry() @@ -119,7 +122,10 @@ def PermissionIdsVocabulary(context=None): Terms are sorted by title except for 'Public', which always appears as the first term. - To illustrate, we need to register the permission IDs vocab: + To illustrate, we need to register the permission IDs vocabulary: + + >>> from zope.schema.vocabulary import _clear + >>> _clear() >>> from zope.schema.vocabulary import getVocabularyRegistry >>> registry = getVocabularyRegistry() -- cgit v1.2.1