1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

s4:ldap.py - check if the "name" of an entry was really ignored

This commit is contained in:
Matthias Dieter Wallnöfer 2010-06-11 09:17:08 +02:00
parent 4d3362776f
commit ace9bd6560

View File

@ -753,11 +753,17 @@ class BasicTests(unittest.TestCase):
"objectclass": "group",
"name": "ldaptestgroupx"})
# proof if the name has been set correctly
res = ldb.search("cn=ldaptestgroup,cn=users," + self.base_dn,
scope=SCOPE_BASE, attrs=["name"])
self.assertTrue(len(res) == 1)
self.assertTrue("name" in res[0])
self.assertTrue(res[0]["name"][0] == "ldaptestgroup")
m = Message()
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
m["name"] = MessageElement("cn=ldaptestuser", FLAG_MOD_REPLACE,
"name")
try:
ldb.modify(m)
self.fail()
@ -768,7 +774,6 @@ class BasicTests(unittest.TestCase):
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
m["cn"] = MessageElement("ldaptestuser",
FLAG_MOD_REPLACE, "cn")
try:
ldb.modify(m)
self.fail()