Skip to content

Commit

Permalink
- Repair tests, adding dummy user for _setObject's sake.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Oct 12, 2001
1 parent 711acdf commit 362c723
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/testCatalog.py
Expand Up @@ -24,6 +24,17 @@
# Stuff of Chris
################################################################################

from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager

class DummyUser:

def __init__( self, name ):
self._name = name

def getUserName( self ):
return self._name


class CatalogBase:
def setUp(self):
Expand All @@ -34,7 +45,7 @@ def setUp(self):
def tearDown(self):
self._vocabulary = self._catalog = None

class TestAddDelColumn(unittest.TestCase,CatalogBase):
class TestAddDelColumn(CatalogBase,unittest.TestCase):
def testAdd(self):
self._catalog.addColumn('id')
assert self._catalog.schema.has_key('id') == 1, 'add column failed'
Expand Down Expand Up @@ -101,7 +112,9 @@ def tearDown(self):

def testInstantiateWithoutVocab(self):
v = Vocabulary.Vocabulary('Vocabulary', 'Vocabulary', globbing=1)
newSecurityManager( None, DummyUser( 'phred' ) )
zc = ZCatalog.ZCatalog('acatalog')
noSecurityManager()
assert hasattr(zc, 'Vocabulary')
assert zc.getVocabulary().__class__ == v.__class__

Expand Down

0 comments on commit 362c723

Please sign in to comment.