[Zope3-checkins]
CVS: Zope3/src/zope/app/browser/form/complexsample/tests
- test_widget.py:1.6
Jim Fulton
cvs-admin at zope.org
Fri Nov 21 12:12:26 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/form/complexsample/tests
In directory cvs.zope.org:/tmp/cvs-serv31883/src/zope/app/browser/form/complexsample/tests
Modified Files:
test_widget.py
Log Message:
Changed to use the new ztapi module, which provides handy functions
for setting up adapters and views for tests. This is needed because
there are no-longer global adapter and view services sitting around as
module globals.
=== Zope3/src/zope/app/browser/form/complexsample/tests/test_widget.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/form/complexsample/tests/test_widget.py:1.5 Fri Aug 22 16:02:11 2003
+++ Zope3/src/zope/app/browser/form/complexsample/tests/test_widget.py Fri Nov 21 12:11:55 2003
@@ -16,16 +16,15 @@
import unittest
+from zope.app.tests import ztapi
from zope.app.browser.form.tests import support
from zope.app.browser.form import vocabularywidget
from zope.app.interfaces.form import WidgetInputError
from zope.app.tests.placelesssetup import PlacelessSetup
from zope.component import getView
-from zope.component.view import provideView
from zope.interface.declarations import \
directlyProvides, providedBy, implements
from zope.publisher.browser import TestRequest
-from zope.publisher.interfaces.browser import IBrowserPresentation
from zope.schema.interfaces import IVocabularyField
from zope.schema.interfaces import IVocabularyUniqueListField
from zope.schema import vocabulary
@@ -129,32 +128,32 @@
def setUp(self):
PlacelessSetup.setUp(self)
# display
- provideView(IVocabularyUniqueListField,
- "display",
- IBrowserPresentation,
- vocabularywidget.VocabularyUniqueListFieldDisplayWidget)
- provideView(ISampleVocabulary,
- "field-display-unique-list-widget",
- IBrowserPresentation,
- complexsample.SampleListDisplay)
+ ztapi.browserView(
+ IVocabularyUniqueListField,
+ "display",
+ vocabularywidget.VocabularyUniqueListFieldDisplayWidget)
+ ztapi.browserView(
+ ISampleVocabulary,
+ "field-display-unique-list-widget",
+ complexsample.SampleListDisplay)
# edit
- provideView(IVocabularyUniqueListField,
- "edit",
- IBrowserPresentation,
- vocabularywidget.VocabularyUniqueListFieldEditWidget)
- provideView(ISampleVocabulary,
- "field-edit-unique-list-widget",
- IBrowserPresentation,
- complexsample.SampleUniqueListEdit)
+ ztapi.browserView(
+ IVocabularyUniqueListField,
+ "edit",
+ vocabularywidget.VocabularyUniqueListFieldEditWidget)
+ ztapi.browserView(
+ ISampleVocabulary,
+ "field-edit-unique-list-widget",
+ complexsample.SampleUniqueListEdit)
# query support (edit only)
- provideView(IFancySampleVocabularyQuery,
- "widget-query-unique-list-helper",
- IBrowserPresentation,
- complexsample.FancySampleUniqueListQueryView)
- provideView(ISampleVocabularyQuery,
- "widget-query-unique-list-helper",
- IBrowserPresentation,
- complexsample.SampleUniqueListQueryView)
+ ztapi.browserView(
+ IFancySampleVocabularyQuery,
+ "widget-query-unique-list-helper",
+ complexsample.FancySampleUniqueListQueryView)
+ ztapi.browserView(
+ ISampleVocabularyQuery,
+ "widget-query-unique-list-helper",
+ complexsample.SampleUniqueListQueryView)
def createWidget(self, **kw):
request = TestRequest(**kw)
@@ -907,32 +906,32 @@
self.bound = self.unbound.bind(object())
# register the single-selection widgets
# display
- provideView(IVocabularyField,
- "display",
- IBrowserPresentation,
- vocabularywidget.VocabularyFieldDisplayWidget)
- provideView(ISampleVocabulary,
- "field-display-widget",
- IBrowserPresentation,
- complexsample.SampleDisplay)
+ ztapi.browserView(
+ IVocabularyField,
+ "display",
+ vocabularywidget.VocabularyFieldDisplayWidget)
+ ztapi.browserView(
+ ISampleVocabulary,
+ "field-display-widget",
+ complexsample.SampleDisplay)
# edit
- provideView(IVocabularyField,
- "edit",
- IBrowserPresentation,
- vocabularywidget.VocabularyFieldEditWidget)
- provideView(ISampleVocabulary,
- "field-edit-widget",
- IBrowserPresentation,
- complexsample.SampleEdit)
+ ztapi.browserView(
+ IVocabularyField,
+ "edit",
+ vocabularywidget.VocabularyFieldEditWidget)
+ ztapi.browserView(
+ ISampleVocabulary,
+ "field-edit-widget",
+ complexsample.SampleEdit)
# query support (edit only) --
- provideView(IFancySampleVocabularyQuery,
- "widget-query-helper",
- IBrowserPresentation,
- complexsample.FancySampleQueryView)
- provideView(ISampleVocabularyQuery,
- "widget-query-helper",
- IBrowserPresentation,
- complexsample.SampleQueryView)
+ ztapi.browserView(
+ IFancySampleVocabularyQuery,
+ "widget-query-helper",
+ complexsample.FancySampleQueryView)
+ ztapi.browserView(
+ ISampleVocabularyQuery,
+ "widget-query-helper",
+ complexsample.SampleQueryView)
def test_display_empty(self):
self.viewName = "display"
More information about the Zope3-Checkins
mailing list