Tag Archives: zope

Run tests using layers with py.test

TL;DR Use gocept.pytestlayer. Long Story We have many test suites which use test layers (e. g. the ones from plone.testing). We want to use py.test and all its fancy features to have a modern test runner. There was no way to … Continue reading

Posted in en | Tagged , , , , , , , | Leave a comment

News from the toolbox: gocept.selenium and our plans for its future

For a couple of years, we at gocept have been developing a Python library, gocept.selenium, whose goal it is to integrate testing web sites in real browsers with the Python unittest framework. There exist a number of approaches to doing … Continue reading

Posted in en, Uncategorized | Tagged , , , , , , , | 2 Comments

Custom widgets in zope.formlib

zope.formlib has the ability to customize the used widget like this: class KeywordsManagementForm(five.formlib.formbase.SubPageForm): form_fields = zope.formlib.form.Fields(IKeywords) form_fields[‘keywords’].custom_widget = KWSelectWidgetFactory I do not like this approach for two reasons: the widget has to be set manually every time the specific field is used … Continue reading

Posted in en | Tagged , , , , | 2 Comments

Get a zc.sourcefactory to implement an interface

zc.sourcefactory is very handy to easily create a source (zope.schema.interfaces.IIterableSource to be precise) with corresponding titles and tokens for its contents. Every now and then a source requires an explicit interface. For zc.sourcefactory the following code snippet helps: class IMySource(zope.schema.interfaces.IIterableSource): … Continue reading

Posted in en | Tagged , , | Leave a comment