I'm writing tests for my replacement views. In the preferences form I use  
a vocabulary to list the possible skin choices. For testing the forms I'm  
generally using doctests to check the rendered HTML but I haven't been  
able to work out how to add get a dummy vocabulary to work with the test  
although it is correctly registered. This is from my doctest:

Set up dummy skins vocabulary
     >>> from zope.schema.interfaces import IVocabularyFactory
     >>> from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
     >>> terms = [SimpleTerm('default', 'default', 'default'),  
SimpleTerm('fancy', 'fancy', 'fancy')]
     >>> vocab = lambda: SimpleVocabulary(terms)
     >>> from zope.component import getSiteManager
     >>> sm = getSiteManager()
     >>> sm.registerUtility(vocab, IVocabularyFactory, u'cmf.portal_skins')

But as soon as I call the preferences form I get (after logging in)

>> browser.open("http://localhost/site/@@preferences.html";)

Error Value:\n unknown vocabulary: u\'cmf.portal_skins\'

Any ideas?

I've commited the doctest with the failing issues commented out.

Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
Zope-CMF maillist  -  Zope-CMF@zope.org

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Reply via email to