summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/python/samba/tests/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index 0519fd8dc5..2248292b89 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -175,3 +175,9 @@ def connect_samdb_ex(samdb_url, lp=None, session_info=None,
# fetch RootDse
res = sam_db.search(base="", expression="", scope=ldb.SCOPE_BASE, attrs=["*"])
return (sam_db, res[0])
+
+def delete_force(samdb, dn):
+ try:
+ samdb.delete(dn)
+ except ldb.LdbError, (num, _):
+ assert(num == ldb.ERR_NO_SUCH_OBJECT)