[Zope3-checkins] CVS: Zope3/src/zope/app/component/tests - module.py:1.3 test_contentdirective.py:1.4 test_directives.py:1.12 test_factory.py:1.5 test_requirepermissions.py:1.5 test_servicedirective.py:1.8

Anthony Baxter anthony@interlink.com.au
Sat, 2 Aug 2003 05:11:55 -0400


Update of /cvs-repository/Zope3/src/zope/app/component/tests
In directory cvs.zope.org:/tmp/cvs-serv24272/zope/app/component/tests

Modified Files:
	module.py test_contentdirective.py test_directives.py 
	test_factory.py test_requirepermissions.py 
	test_servicedirective.py 
Log Message:
Backing out philiKON's changes - they broke the functional tests, and
from his signoff on IRC, I don't think he's going to be around until 
Monday. As I'm working on the Catalog functional tests, this is pretty
annoying. I tried to figure out how to just back out bits til I found the
broken stuff, but it's a pretty serious refactoring. I'll send a message
to zope3-checkins with the CVS commands used for this, so that someone
can undo the backout if they wish.


=== Zope3/src/zope/app/component/tests/module.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/component/tests/module.py:1.2	Sat Aug  2 03:04:05 2003
+++ Zope3/src/zope/app/component/tests/module.py	Sat Aug  2 05:11:18 2003
@@ -50,7 +50,7 @@
     bar2 = Text()
 
 
-template_bracket = """<configure
+template_bracket = """<zopeConfigure
    xmlns="http://namespaces.zope.org/zope">
    %s
-</configure>"""
+</zopeConfigure>"""


=== Zope3/src/zope/app/component/tests/test_contentdirective.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/component/tests/test_contentdirective.py:1.3	Sat Aug  2 03:04:05 2003
+++ Zope3/src/zope/app/component/tests/test_contentdirective.py	Sat Aug  2 05:11:18 2003
@@ -38,10 +38,10 @@
 
 
 def configfile(s):
-    return StringIO("""<configure
+    return StringIO("""<zopeConfigure
       xmlns='http://namespaces.zope.org/zope'>
       %s
-      </configure>
+      </zopeConfigure>
       """ % s)
 
 class TestContentDirective(PlacelessSetup, unittest.TestCase):


=== Zope3/src/zope/app/component/tests/test_directives.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/component/tests/test_directives.py:1.11	Sat Aug  2 03:04:05 2003
+++ Zope3/src/zope/app/component/tests/test_directives.py	Sat Aug  2 05:11:18 2003
@@ -37,11 +37,11 @@
 from zope.interface import implements
 
 
-template = """<configure
+template = """<zopeConfigure
    xmlns='http://namespaces.zope.org/zope'
    xmlns:test='http://www.zope.org/NS/Zope3/test'>
    %s
-   </configure>"""
+   </zopeConfigure>"""
 
 class Ob:
     implements(IC)
@@ -479,11 +479,18 @@
                id="foo"
                component="zope.component.tests.factory.f"
                />
+            <factory
+               component="zope.component.tests.factory.f"
+               />
             """
             )))
 
         from zope.component.tests.factory import X
         self.assertEqual(createObject(None, 'foo').__class__, X)
+        self.assertEqual(createObject(
+            None,
+            'zope.component.tests.factory.f').__class__, X)
+
 
 def test_suite():
     return unittest.makeSuite(Test)


=== Zope3/src/zope/app/component/tests/test_factory.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/component/tests/test_factory.py:1.4	Sat Aug  2 03:04:05 2003
+++ Zope3/src/zope/app/component/tests/test_factory.py	Sat Aug  2 05:11:18 2003
@@ -29,10 +29,10 @@
 from zope.app.component.tests.exampleclass import ExampleClass
 
 def configfile(s):
-    return StringIO("""<configure
+    return StringIO("""<zopeConfigure
       xmlns='http://namespaces.zope.org/zope'>
       %s
-      </configure>
+      </zopeConfigure>
       """ % s)
 
 class Test(PlacelessSetup, unittest.TestCase):
@@ -42,6 +42,7 @@
         XMLConfig('meta.zcml', zope.app.component)()
         XMLConfig('meta.zcml', zope.app.security)()
 
+
     def testFactory(self):
         from zope.component import getService
         from zope.proxy import removeAllProxies
@@ -60,6 +61,26 @@
         obj = getService(None, Factories).createObject('Example')
         obj = removeAllProxies(obj)
         self.failUnless(isinstance(obj, ExampleClass))
+
+    def testFactoryDefaultId(self):
+        from zope.component import getService
+        from zope.proxy import removeAllProxies
+        f = configfile("""
+<permission id="zope.Foo" title="Zope Foo Permission" />
+<content class="zope.app.component.tests.exampleclass.ExampleClass">
+    <factory
+      permission="zope.Foo"
+      title="Example content"
+      description="Example description"
+       />
+</content>
+                       """)
+        xmlconfig(f)
+        obj = getService(None, Factories).createObject(
+            'zope.app.component.tests.exampleclass.ExampleClass')
+        obj = removeAllProxies(obj)
+        self.failUnless(isinstance(obj, ExampleClass))
+
 
 def test_suite():
     loader=unittest.TestLoader()


=== Zope3/src/zope/app/component/tests/test_requirepermissions.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/component/tests/test_requirepermissions.py:1.4	Sat Aug  2 03:04:05 2003
+++ Zope3/src/zope/app/component/tests/test_requirepermissions.py	Sat Aug  2 05:11:18 2003
@@ -33,11 +33,11 @@
 def defineDirectives():
     XMLConfig('meta.zcml', zope.app.component)()
     XMLConfig('meta.zcml', zope.app.security)()
-    xmlconfig(StringIO("""<configure
+    xmlconfig(StringIO("""<zopeConfigure
         xmlns='http://namespaces.zope.org/zope' >
        <permission id="extravagant" title="extravagant" />
        <permission id="paltry" title="paltry" />
-    </configure>"""))
+    </zopeConfigure>"""))
 
 NOTSET = []
 


=== Zope3/src/zope/app/component/tests/test_servicedirective.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/component/tests/test_servicedirective.py:1.7	Sat Aug  2 03:04:05 2003
+++ Zope3/src/zope/app/component/tests/test_servicedirective.py	Sat Aug  2 05:11:18 2003
@@ -26,11 +26,13 @@
 from zope.component import getService
 from zope.app.tests.placelesssetup import PlacelessSetup
 
-template = """<configure
+
+template = """<zopeConfigure
    xmlns='http://namespaces.zope.org/zope'
    xmlns:test='http://www.zope.org/NS/Zope3/test'>
    %s
-   </configure>"""
+   </zopeConfigure>"""
+
 
 class Test(PlacelessSetup, unittest.TestCase):