diff options
Diffstat (limited to 'okupy/tests/unit/test_ldapuser.py')
-rw-r--r-- | okupy/tests/unit/test_ldapuser.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/okupy/tests/unit/test_ldapuser.py b/okupy/tests/unit/test_ldapuser.py index 7dd2b5f..4ca821f 100644 --- a/okupy/tests/unit/test_ldapuser.py +++ b/okupy/tests/unit/test_ldapuser.py @@ -23,12 +23,17 @@ class LDAPUserUnitTests(TestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.mockldap.start() - self.ldapobject = self.mockldap[settings.AUTH_LDAP_SERVER_URI] + self.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI] def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_return_unicode_username(self): alice = LDAPUser.objects.get(username='alice') @@ -39,7 +44,7 @@ class LDAPUserUnitTests(TestCase): secondary_password = Random.get_random_bytes(48) secondary_password_crypt = ldap_md5_crypt.encrypt(b64encode( secondary_password)) - self.ldapobject.directory[ldap_users('alice')[0]][ + self.ldapobj.directory[ldap_users('alice')[0]][ 'userPassword'].append(secondary_password_crypt) request = set_request('/', user=vars.USER_ALICE) request.session['secondary_password'] = cipher.encrypt( @@ -51,7 +56,7 @@ class LDAPUserUnitTests(TestCase): secondary_password = Random.get_random_bytes(48) secondary_password_crypt = ldap_md5_crypt.encrypt(b64encode( secondary_password)) - self.ldapobject.directory[ldap_users('alice')[0]][ + self.ldapobj.directory[ldap_users('alice')[0]][ 'userPassword'].append(secondary_password_crypt) request = set_request('/', user=vars.USER_ALICE) request.session['secondary_password'] = cipher.encrypt( @@ -102,7 +107,7 @@ class LDAPUserUnitTests(TestCase): secondary_password = Random.get_random_bytes(48) secondary_password_crypt = ldap_md5_crypt.encrypt(b64encode( secondary_password)) - self.ldapobject.directory[ldap_users('alice')[0]][ + self.ldapobj.directory[ldap_users('alice')[0]][ 'userPassword'].append(secondary_password_crypt) request = set_request('/', user=vars.USER_ALICE) request.session['secondary_password'] = cipher.encrypt( |