コード例 #1
0
 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)
コード例 #2
0
ファイル: vocabulary.py プロジェクト: jean/zope.app.schema
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())
コード例 #3
0
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())
コード例 #4
0
ファイル: testing.py プロジェクト: felixonmars/z3c.language
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)
コード例 #5
0
 def setUp(self):
     vocabulary._clear()
     vr = vocabulary.getVocabularyRegistry()
     vr.register("states", states.StateVocabulary)
コード例 #6
0
def clearVocabulary(testcase):
    from zope.schema.vocabulary import _clear
    _clear()
コード例 #7
0
ファイル: test_states.py プロジェクト: grodniewicz/oship
 def setUp(self):
     vocabulary._clear()
     vr = vocabulary.getVocabularyRegistry()
     vr.register("states", states.StateVocabulary)
コード例 #8
0
def tearDownCategorySet(test):
    placefulTearDown()
    tearDown(test)
    from zope.schema.vocabulary import _clear
    _clear()
コード例 #9
0
ファイル: test_vocabulary.py プロジェクト: grodniewicz/oship
 def tearDown(self):
     vocabulary._clear()
コード例 #10
0
 def tearDown(self):
     from zope.schema.vocabulary import _clear
     _clear()
コード例 #11
0
def tearDownPlaces(test):
    placefulTearDown()
    from zope.schema.vocabulary import _clear
    _clear()
コード例 #12
0
 def setUp(self):
     vocabulary._clear()
コード例 #13
0
ファイル: tests.py プロジェクト: goschtl/zope
def _clearVocabulary(ztc):
    from zope.schema.vocabulary import _clear
    _clear()
コード例 #14
0
ファイル: testing.py プロジェクト: felixonmars/z3c.language
def doctestTearDown(test):
    setup.placefulTearDown()
    vocabulary._clear()
コード例 #15
0
 def tearDown(self):
     vocabulary._clear()
コード例 #16
0
 def setUp(self):
     from zope.schema.vocabulary import _clear
     _clear()
コード例 #17
0
 def setUp(self):
     from zope.schema.vocabulary import _clear
     _clear()
コード例 #18
0
ファイル: test_vocabulary.py プロジェクト: grodniewicz/oship
 def setUp(self):
     vocabulary._clear()
コード例 #19
0
 def tearDown(self):
     from zope.schema.vocabulary import _clear
     _clear()
コード例 #20
0
def _clearVocabulary(ztc):
    from zope.schema.vocabulary import _clear
    _clear()
コード例 #21
0
def tearDownFieldConfig(test):
    placefulTearDown()
    tearDown(test)
    from zope.schema.vocabulary import _clear
    _clear()