[Zope3-checkins] CVS: Zope3/src/zope/app/form/browser/tests -
test_directives.py:1.3
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 23 17:08:38 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/form/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv22597/src/zope/app/form/browser/tests
Modified Files:
test_directives.py
Log Message:
Rip out usage everywhere.
=== Zope3/src/zope/app/form/browser/tests/test_directives.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/form/browser/tests/test_directives.py:1.2 Wed Mar 17 12:37:06 2004
+++ Zope3/src/zope/app/form/browser/tests/test_directives.py Tue Mar 23 17:08:07 2004
@@ -79,8 +79,6 @@
ztapi.provideAdapter(None, ITraversable, DefaultTraversable)
ps = zapi.getService(None, zapi.servicenames.Presentation)
- ps.defineUsage("objectview")
- ps.defineUsage("overridden")
def testEditForm(self):
self.assertEqual(zapi.queryView(ob, 'test', request),
@@ -112,7 +110,7 @@
self.assertEqual(zapi.queryView(ob, 'test', request),
None)
xmlconfig(StringIO(template % ("""
- <browser:menu id="test_menu" title="Test menu" usage="objectview"/>
+ <browser:menu id="test_menu" title="Test menu"/>
<view
type="zope.publisher.interfaces.browser.IBrowserRequest"
for="zope.schema.interfaces.ITextLine"
@@ -133,67 +131,9 @@
""")))
v = zapi.queryView(ob, 'edit.html', request)
- self.assertEqual(v.usage, 'objectview')
# expect component lookup as standard macros are not configured
self.assertRaises(ComponentLookupError, v)
- def testEditFormWithUsage(self):
- self.assertEqual(zapi.queryView(ob, 'test', request),
- None)
- xmlconfig(StringIO(template % ("""
- <view
- type="zope.publisher.interfaces.browser.IBrowserRequest"
- for="zope.schema.interfaces.ITextLine"
- provides="zope.app.form.interfaces.IInputWidget"
- factory="zope.app.form.browser.TextWidget"
- permission="zope.Public"
- />
- <browser:editform
- for="zope.app.form.browser.tests.test_directives.IC"
- schema="zope.app.form.browser.tests.test_directives.Schema"
- name="edit.html"
- label="Edit a ZPT page"
- fields="text"
- permission="zope.Public"
- usage="objectview"
- />
- """)))
-
- v = zapi.queryView(ob, 'edit.html', request)
- self.assertEqual(v.usage, 'objectview')
- # expect component lookup as standard macros are not configured
- self.assertRaises(ComponentLookupError, v)
-
-
- def testEditFormWithMenuAndUsage(self):
- self.assertEqual(zapi.queryView(ob, 'test', request),
- None)
- xmlconfig(StringIO(template % ("""
- <browser:menu id="test_menu" title="Test menu" usage="overridden"/>
- <view
- type="zope.publisher.interfaces.browser.IBrowserRequest"
- for="zope.schema.interfaces.ITextLine"
- provides="zope.app.form.interfaces.IInputWidget"
- factory="zope.app.form.browser.TextWidget"
- permission="zope.Public"
- />
- <browser:editform
- for="zope.app.form.browser.tests.test_directives.IC"
- schema="zope.app.form.browser.tests.test_directives.Schema"
- name="edit.html"
- label="Edit a ZPT page"
- fields="text"
- permission="zope.Public"
- menu="test_menu"
- title="Test View"
- usage="objectview"
- />
- """)))
-
- v = zapi.queryView(ob, 'edit.html', request)
- self.assertEqual(v.usage, 'objectview')
- # expect component lookup as standard macros are not configured
- self.assertRaises(ComponentLookupError, v)
# XXX Tests for AddFormDirective are missing
More information about the Zope3-Checkins
mailing list