# objects can be slow to replicate out. So the OU created by a previous
# testenv may still exist at the point that tests start on another testenv.
rand = randint(1, 10000000)
- dn = "OU=%s%d,%s" %(name, rand, samdb.get_default_basedn())
+ dn = ldb.Dn(samdb, "OU=%s%d,%s" %(name, rand, samdb.get_default_basedn()))
samdb.add({ "dn": dn, "objectclass": "organizationalUnit"})
return dn
def add_user(self, username):
# add a new user to the DB under our top-level OU
- userou = self.ou.split(',')[0]
+ userou = "ou=%s" % self.ou.get_component_value(0)
return TestUser(username, self.ldb, userou=userou)
def assert_password_invalid(self, user, password):
# you can apply a PSO to other objects (like OUs), but the resultantPSO
# attribute should only be returned for users
- dummy_pso.apply_to(self.ou)
+ dummy_pso.apply_to(str(self.ou))
res = self.ldb.search(self.ou, attrs=['msDS-ResultantPSO'])
self.assertFalse('msDS-ResultantPSO' in res[0])
# the vampire_dc), so we point this test directly at that DC
self.set_test_ldb_dc(self.ldb_dc2)
- self.ou = samba.tests.create_test_ou(self.test_ldb_dc, "getncchanges")
+ self.ou = str(samba.tests.create_test_ou(self.test_ldb_dc,
+ "getncchanges"))
self.base_dn = self.test_ldb_dc.get_default_basedn()
self.default_conn = DcConnection(self, self.ldb_dc2, self.dnsname_dc2)