[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ContentDirective/tests - testDirectives.py:1.10

Viktorija Zaksiene ryzaja@codeworks.lt
Mon, 25 Nov 2002 10:23:51 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ContentDirective/tests
In directory cvs.zope.org:/tmp/cvs-serv7564/ContentDirective/tests

Modified Files:
	testDirectives.py 
Log Message:
Added check for undefined permissions on configuration time.


=== Zope3/lib/python/Zope/App/ContentDirective/tests/testDirectives.py 1.9 => 1.10 ===
--- Zope3/lib/python/Zope/App/ContentDirective/tests/testDirectives.py:1.9	Wed Nov  6 17:30:21 2002
+++ Zope3/lib/python/Zope/App/ContentDirective/tests/testDirectives.py	Mon Nov 25 10:23:20 2002
@@ -29,6 +29,7 @@
 import Zope.App.ComponentArchitecture
 import Zope.App.Security
 import Zope.App.ContentDirective
+from Zope.App.Security.Exceptions import UndefinedPermissionError
 
 # explicitly import ExampleClass and IExample using full paths
 # so that they are the same objects as resolve will get.
@@ -122,6 +123,25 @@
 </content>
                        """)
         xmlconfig(f)
+
+
+    def testFactoryUndefinedPermission(self):
+         
+        f = configfile("""
+<permission id="Zope.Foo" title="Zope Foo Permission" />
+
+<content class="Zope.App.ContentDirective.tests.ExampleClass.">
+    <factory 
+      id="Example" 
+      permission="UndefinedPermission"
+      title="Example content"
+      description="Example description"
+    />
+</content>
+            """)
+        self.assertRaises(UndefinedPermissionError, xmlconfig, f,
+                          testing=1)
+
 
 def test_suite():
     suite = unittest.TestSuite()