[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container/tests -
test_adding.py:1.9
Stephan Richter
srichter at cosmos.phy.tufts.edu
Sat Aug 16 11:08:22 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/container/tests
In directory cvs.zope.org:/tmp/cvs-serv20635/browser/container/tests
Modified Files:
test_adding.py
Log Message:
In Garrett's last checking he required that a content name must be specified
in order for the adding to work. This was a too hard of a restriction, since
some containers know how to generate names themselves. Good examples are
the Authentication Source and the Registration Manager components. I have
removed that requirement and fixed the test.
=== Zope3/src/zope/app/browser/container/tests/test_adding.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/container/tests/test_adding.py:1.8 Fri Aug 15 20:42:42 2003
+++ Zope3/src/zope/app/browser/container/tests/test_adding.py Sat Aug 16 10:08:15 2003
@@ -47,6 +47,8 @@
implements(IZopeContainer)
def setObject(self, name, obj):
+ if name is None:
+ name = 'chosen'
self[name] = obj
return name
@@ -162,8 +164,12 @@
self.assert_('baz' in container)
# alternative add w/missing contentName
+ # Note: Passing is None as object name might be okay, if the container
+ # is able to hand out ids itself. Let's not require a content
+ # name to be specified!
adding.contentName = None
- self.assertRaises(ValueError, adding.action, type_name='foo')
+ adding.action(type_name='foo')
+ self.assert_('chosen' in container)
def test_action(self):
More information about the Zope3-Checkins
mailing list