def setUp(self): from zope.schema.vocabulary import _clear from zope.schema.vocabulary import getVocabularyRegistry from zope.schema.tests.states import StateVocabulary _clear() vr = getVocabularyRegistry() vr.register("states", StateVocabulary)
def _clear(): """Re-initialize the vocabulary registry.""" # This should normally only be needed by the testing framework, # but is also used for module initialization. global vocabularyRegistry vocabulary._clear() vocabularyRegistry = vocabulary.getVocabularyRegistry() vocabulary._clear() vocabulary.setVocabularyRegistry(ZopeVocabularyRegistry())
def _clear(): """Re-initialize the vocabulary registry.""" # This should normally only be needed by the testing framework, # but is also used for module initialization. global vocabularyRegistry # The net effect of these two lines is to have this modules # vocabularyRegistry set to zope.schema.vocabulary.VocabularyRegistry() vocabulary._clear() vocabularyRegistry = vocabulary.getVocabularyRegistry() vocabulary._clear() # Which we immediately replace vocabulary.setVocabularyRegistry(ZopeVocabularyRegistry())
def doctestSetUp(test): site = setup.placefulSetUp(site=True) test.globs['rootFolder'] = site # session setup zope.component.provideAdapter(TestClientId, (IRequest,), IClientId) zope.component.provideAdapter(LanguageSession, (IRequest,), ILanguageSession) zope.component.provideUtility(CookieClientIdManager(), IClientIdManager) rsdc = session.RAMSessionDataContainer() zope.component.provideUtility(rsdc, ISessionDataContainer, '') # register vocabularies vocabulary.setVocabularyRegistry(None) vocabulary._clear() vr = vocabulary.getVocabularyRegistry() vr.register('Offered Languages', OfferedLanguagesVocabulary)
def setUp(self): vocabulary._clear() vr = vocabulary.getVocabularyRegistry() vr.register("states", states.StateVocabulary)
def clearVocabulary(testcase): from zope.schema.vocabulary import _clear _clear()
def tearDownCategorySet(test): placefulTearDown() tearDown(test) from zope.schema.vocabulary import _clear _clear()
def tearDown(self): vocabulary._clear()
def tearDown(self): from zope.schema.vocabulary import _clear _clear()
def tearDownPlaces(test): placefulTearDown() from zope.schema.vocabulary import _clear _clear()
def setUp(self): vocabulary._clear()
def _clearVocabulary(ztc): from zope.schema.vocabulary import _clear _clear()
def doctestTearDown(test): setup.placefulTearDown() vocabulary._clear()
def setUp(self): from zope.schema.vocabulary import _clear _clear()
def tearDownFieldConfig(test): placefulTearDown() tearDown(test) from zope.schema.vocabulary import _clear _clear()