summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource4/dsdb/tests/python/ldap_schema.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/source4/dsdb/tests/python/ldap_schema.py b/source4/dsdb/tests/python/ldap_schema.py
index bc7069e999..64da563e22 100755
--- a/source4/dsdb/tests/python/ldap_schema.py
+++ b/source4/dsdb/tests/python/ldap_schema.py
@@ -24,6 +24,7 @@ from ldb import Message, MessageElement, Dn
from ldb import FLAG_MOD_REPLACE
from samba.samdb import SamDB
from samba.dsdb import DS_DOMAIN_FUNCTION_2003
+from samba.tests import delete_force
from subunit.run import SubunitTestRunner
import unittest
@@ -49,12 +50,6 @@ creds = credopts.get_credentials(lp)
class SchemaTests(unittest.TestCase):
- def delete_force(self, ldb, dn):
- try:
- ldb.delete(dn)
- except LdbError, (num, _):
- self.assertEquals(num, ERR_NO_SUCH_OBJECT)
-
def setUp(self):
super(SchemaTests, self).setUp()
self.ldb = ldb
@@ -192,7 +187,7 @@ name: """ + object_name + """
res = self.ldb.search("cn=%s,cn=Users,%s" % (object_name, self.base_dn), scope=SCOPE_BASE, attrs=["*"])
self.assertEquals(len(res), 1)
# Delete the object
- self.delete_force(self.ldb, "cn=%s,cn=Users,%s" % (object_name, self.base_dn))
+ delete_force(self.ldb, "cn=%s,cn=Users,%s" % (object_name, self.base_dn))
def test_subClassOf(self):
""" Testing usage of custom child schamaClass
@@ -248,7 +243,7 @@ instanceType: 4
res = self.ldb.search("ou=%s,%s" % (object_name, self.base_dn), scope=SCOPE_BASE, attrs=["*"])
self.assertEquals(len(res), 1)
# Delete the object
- self.delete_force(self.ldb, "ou=%s,%s" % (object_name, self.base_dn))
+ delete_force(self.ldb, "ou=%s,%s" % (object_name, self.base_dn))
class SchemaTests_msDS_IntId(unittest.TestCase):