def setup_module(module): global slapd slapd = Slapd() slapd.add_ldif('''dn: uid=etienne.michu,o=orga objectClass: inetOrgPerson userPassword: pass uid: etienne.michu cn: Étienne Michu sn: Michu gn: Étienne mail: [email protected]''')
class LDAPBaseTestCase(TestCase): slapd = None def setUp(self): if self.slapd is None: self.slapd = Slapd() self.slapd.checkpoint() # fresh connection self.conn = self.slapd.get_connection() def tearDown(self): self.slapd.restore()
def setUp(self): if self.slapd is None: self.slapd = Slapd() self.slapd.checkpoint() # fresh connection self.conn = self.slapd.get_connection()