8687.15.18
by Karl Fogel
Add the copyright header block to files under lib/canonical/. |
1 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
|
2 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
|
3979.1.4
by Guilherme Salgado
Add a new +series page for IProducts, plus a few refactorings |
3 |
|
4 |
"""Testing helpers."""
|
|
5 |
||
6 |
__metaclass__ = type |
|
7 |
__all__ = ['verifyObject'] |
|
8 |
||
9 |
from zope.interface.verify import verifyObject as zope_verifyObject |
|
10 |
from zope.security.proxy import removeSecurityProxy |
|
11 |
||
12 |
||
13 |
def verifyObject(iface, candidate, tentative=0): |
|
14 |
"""A specialized verifyObject which removes the security proxy of the
|
|
15 |
object before verifying it.
|
|
16 |
"""
|
|
17 |
naked_candidate = removeSecurityProxy(candidate) |
|
18 |
return zope_verifyObject(iface, naked_candidate, tentative=0) |
|
19 |