[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ContentDirective/tests - testFactory.py:1.1.2.3
Jim Fulton
jim@zope.com
Tue, 4 Jun 2002 14:01:24 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ContentDirective/tests
In directory cvs.zope.org:/tmp/cvs-serv10539/lib/python/Zope/App/ContentDirective/tests
Modified Files:
Tag: Zope3InWonderland-branch
testFactory.py
Log Message:
Modified content/factory directive to default factory id to the dotted class name
=== Zope3/lib/python/Zope/App/ContentDirective/tests/testFactory.py 1.1.2.2 => 1.1.2.3 ===
self.failUnless(isinstance(obj, ExampleClass))
+ def testFactoryDefaultId(self):
+ from Zope.ComponentArchitecture import getService
+ from Zope.Proxy.ProxyIntrospection import removeAllProxies
+ f = configfile("""
+<security:permission id="Zope.Foo" title="Zope Foo Permission" />
+<content class="Zope.App.ContentDirective.tests.ExampleClass.">
+ <zmi:factory
+ permission="Zope.Foo"
+ title="Example content"
+ description="Example description"
+ for_container="Zope.App.ContentDirective.tests.ExampleClass.IExampleContainer"
+ creation_markers="Zope.App.ContentDirective.tests.ExampleClass.IExample"
+ />
+</content>
+ """)
+ xmlconfig(f)
+ obj = getService(None, "Factories").createObject(
+ 'Zope.App.ContentDirective.tests.ExampleClass.')
+ obj = removeAllProxies(obj)
+ self.failUnless(isinstance(obj, ExampleClass))
+
def test_suite():
loader=unittest.TestLoader()
@@ -80,3 +101,6 @@
if __name__=='__main__':
unittest.TextTestRunner().run(test_suite())
+
+
+