diff options
author | Dan Korostelev <nadako@gmail.com> | 2009-03-15 00:51:22 +0000 |
---|---|---|
committer | Dan Korostelev <nadako@gmail.com> | 2009-03-15 00:51:22 +0000 |
commit | 773d6f970f72c4a975ec53810d898d1547e110b0 (patch) | |
tree | efc3cfa874d2aeeb543db7dfa8ffc7ae71f49ff4 | |
parent | 078d35ee698b34952ed99e4188af748e7f3ce273 (diff) | |
download | zope-security-773d6f970f72c4a975ec53810d898d1547e110b0.tar.gz |
Ensure that simple zope.schema's VocabularyRegistry is used for PermissionVocabulary tests to make them work in the KGS testing environment.
-rw-r--r-- | CHANGES.txt | 5 | ||||
-rw-r--r-- | 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() |