s4:ldap.py - test for an invalid "objectCategory" attribute
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 7 Aug 2010 09:07:03 +0000 (11:07 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 7 Aug 2010 12:22:42 +0000 (14:22 +0200)
source4/dsdb/tests/python/ldap.py

index 17100904a05144e44bf5fdcf596a5bf7c4fcdb74..133ff584aca35be2e26e6868f7b98b8df0413b44 100755 (executable)
@@ -142,6 +142,16 @@ class BasicTests(unittest.TestCase):
         except LdbError, (num, _):
             self.assertEquals(num, ERR_NO_SUCH_ATTRIBUTE)
 
+        # Invalid objectCategory specified
+        try:
+            self.ldb.add({
+                "dn": "cn=ldaptestuser,cn=users," + self.base_dn,
+                "objectClass": "person",
+                "objectCategory": self.base_dn })
+            self.fail()
+        except LdbError, (num, _):
+            self.assertEquals(num, ERR_OBJECT_CLASS_VIOLATION)
+
         # We cannot instanciate from an abstract objectclass
         try:
             self.ldb.add({