From 63cb79135cdf9a36efd21bc6e2057e486427c52a Mon Sep 17 00:00:00 2001 From: Pavlos Ratis Date: Fri, 20 Sep 2013 15:24:39 +0300 Subject: s/self.ldapobject/self.ldapobj/g --- okupy/tests/integration/test_index.py | 2 +- okupy/tests/integration/test_lists.py | 2 +- okupy/tests/integration/test_login.py | 2 +- okupy/tests/integration/test_settings.py | 2 +- okupy/tests/integration/test_signup.py | 2 +- okupy/tests/unit/test_auth.py | 4 ++-- okupy/tests/unit/test_index.py | 2 +- okupy/tests/unit/test_ldapuser.py | 8 +++---- okupy/tests/unit/test_lists.py | 2 +- okupy/tests/unit/test_login.py | 8 +++---- okupy/tests/unit/test_secondary_password.py | 34 ++++++++++++++--------------- okupy/tests/unit/test_signup.py | 12 +++++----- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/okupy/tests/integration/test_index.py b/okupy/tests/integration/test_index.py index e2c754e..8444186 100644 --- a/okupy/tests/integration/test_index.py +++ b/okupy/tests/integration/test_index.py @@ -16,7 +16,7 @@ class IndexIntegrationTests(TestCase): def setUp(self): self.client = Client() 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() diff --git a/okupy/tests/integration/test_lists.py b/okupy/tests/integration/test_lists.py index a9ad99e..b304b36 100644 --- a/okupy/tests/integration/test_lists.py +++ b/okupy/tests/integration/test_lists.py @@ -17,7 +17,7 @@ class ListsIntegrationTests(TestCase): def setUp(self): self.client = Client() 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() diff --git a/okupy/tests/integration/test_login.py b/okupy/tests/integration/test_login.py index f30c742..2cd6f17 100644 --- a/okupy/tests/integration/test_login.py +++ b/okupy/tests/integration/test_login.py @@ -17,7 +17,7 @@ class LoginIntegrationTests(TestCase): def setUp(self): self.client = Client() 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() diff --git a/okupy/tests/integration/test_settings.py b/okupy/tests/integration/test_settings.py index 3779e51..12931ef 100644 --- a/okupy/tests/integration/test_settings.py +++ b/okupy/tests/integration/test_settings.py @@ -16,7 +16,7 @@ class SettingsIntegrationTests(TestCase): def setUp(self): self.client = Client() 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() diff --git a/okupy/tests/integration/test_signup.py b/okupy/tests/integration/test_signup.py index 86041b5..e848a0b 100644 --- a/okupy/tests/integration/test_signup.py +++ b/okupy/tests/integration/test_signup.py @@ -16,7 +16,7 @@ class SignupIntegrationTests(TestCase): def setUp(self): self.client = Client() 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() diff --git a/okupy/tests/unit/test_auth.py b/okupy/tests/unit/test_auth.py index d514999..a5b005c 100644 --- a/okupy/tests/unit/test_auth.py +++ b/okupy/tests/unit/test_auth.py @@ -21,7 +21,7 @@ class AuthSSLUnitTests(TestCase): 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() @@ -74,7 +74,7 @@ class AuthSSHUnitTests(TestCase): 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() diff --git a/okupy/tests/unit/test_index.py b/okupy/tests/unit/test_index.py index b35d99a..e85df7e 100644 --- a/okupy/tests/unit/test_index.py +++ b/okupy/tests/unit/test_index.py @@ -18,7 +18,7 @@ class IndexUnitTests(TestCase): 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() diff --git a/okupy/tests/unit/test_ldapuser.py b/okupy/tests/unit/test_ldapuser.py index 7dd2b5f..82ba5c4 100644 --- a/okupy/tests/unit/test_ldapuser.py +++ b/okupy/tests/unit/test_ldapuser.py @@ -25,7 +25,7 @@ class LDAPUserUnitTests(TestCase): 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() @@ -39,7 +39,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 +51,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 +102,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( diff --git a/okupy/tests/unit/test_lists.py b/okupy/tests/unit/test_lists.py index d34e27c..ca0f74f 100644 --- a/okupy/tests/unit/test_lists.py +++ b/okupy/tests/unit/test_lists.py @@ -17,7 +17,7 @@ class ListsUnitTests(OkupyTestCase): 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() diff --git a/okupy/tests/unit/test_login.py b/okupy/tests/unit/test_login.py index b602d65..c2acaa2 100644 --- a/okupy/tests/unit/test_login.py +++ b/okupy/tests/unit/test_login.py @@ -27,7 +27,7 @@ class LoginUnitTests(OkupyTestCase): 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() @@ -86,14 +86,14 @@ class LoginUnitTests(OkupyTestCase): login(request) self.assertEqual(len(ldap_users( 'alice', - directory=self.ldapobject.directory)[1]['userPassword']), 2) + directory=self.ldapobj.directory)[1]['userPassword']), 2) self.assertEqual(len(request.session['secondary_password']), 48) def test_secondary_password_is_removed_in_logout(self): 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(uri='/login', post=vars.LOGIN_ALICE, user=vars.USER_ALICE) @@ -102,7 +102,7 @@ class LoginUnitTests(OkupyTestCase): logout(request) self.assertEqual(len(ldap_users( 'alice', - directory=self.ldapobject.directory)[1]['userPassword']), 1) + directory=self.ldapobj.directory)[1]['userPassword']), 1) class LoginUnitTestsNoLDAP(OkupyTestCase): diff --git a/okupy/tests/unit/test_secondary_password.py b/okupy/tests/unit/test_secondary_password.py index ff0a794..b9fbc38 100644 --- a/okupy/tests/unit/test_secondary_password.py +++ b/okupy/tests/unit/test_secondary_password.py @@ -22,7 +22,7 @@ class SecondaryPassword(TestCase): 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() @@ -38,39 +38,39 @@ class SecondaryPassword(TestCase): set_secondary_password(request, 'ldaptest') self.assertEqual(len(ldap_users( 'alice', - directory=self.ldapobject.directory)[1]['userPassword']), 2) + directory=self.ldapobj.directory)[1]['userPassword']), 2) def test_remove_leftovers_before_adding_secondary_password(self): leftover = ldap_md5_crypt.encrypt('leftover_password') - self.ldapobject.directory[ldap_users('alice')[0]][ + self.ldapobj.directory[ldap_users('alice')[0]][ 'userPassword'].append(leftover) request = set_request(uri='/', user=vars.USER_ALICE) set_secondary_password(request, 'ldaptest') self.assertNotIn(leftover, ldap_users( - 'alice', directory=self.ldapobject.directory)[1]['userPassword']) + 'alice', directory=self.ldapobj.directory)[1]['userPassword']) def test_dont_remove_primary_password_while_cleaning_leftovers(self): leftover = ldap_md5_crypt.encrypt('leftover_password') - self.ldapobject.directory[ldap_users('alice')[0]][ + self.ldapobj.directory[ldap_users('alice')[0]][ 'userPassword'].append(leftover) request = set_request(uri='/', user=vars.USER_ALICE) set_secondary_password(request, 'ldaptest') self.assertTrue(ldap_md5_crypt.verify( 'ldaptest', ldap_users( 'alice', - directory=self.ldapobject.directory)[1]['userPassword'][0])) + directory=self.ldapobj.directory)[1]['userPassword'][0])) def test_dont_remove_unknown_hashes_while_cleaning_leftovers(self): leftover = ldap_md5_crypt.encrypt('leftover_password') - self.ldapobject.directory[ldap_users('alice')[0]][ + self.ldapobj.directory[ldap_users('alice')[0]][ 'userPassword'].append(leftover) leftover2 = 'plain_leftover2' - self.ldapobject.directory[ldap_users('alice')[0]][ + self.ldapobj.directory[ldap_users('alice')[0]][ 'userPassword'].append(leftover2) request = set_request(uri='/', user=vars.USER_ALICE) set_secondary_password(request, 'ldaptest') self.assertIn(leftover2, ldap_users( - 'alice', directory=self.ldapobject.directory)[1]['userPassword']) + 'alice', directory=self.ldapobj.directory)[1]['userPassword']) def test_session_and_ldap_secondary_passwords_match(self): request = set_request(uri='/', user=vars.USER_ALICE) @@ -79,26 +79,26 @@ class SecondaryPassword(TestCase): request.session['secondary_password'], 48)), ldap_users( 'alice', - directory=self.ldapobject.directory)[1]['userPassword'][1])) + directory=self.ldapobj.directory)[1]['userPassword'][1])) def test_remove_secondary_password_from_ldap(self): 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(uri='/', user=vars.USER_ALICE) request.session['secondary_password'] = cipher.encrypt( secondary_password) remove_secondary_password(request) self.assertNotIn(secondary_password_crypt, ldap_users( - 'alice', directory=self.ldapobject.directory)[1]['userPassword']) + 'alice', directory=self.ldapobj.directory)[1]['userPassword']) def test_dont_remove_primary_password_when_removing_secondary_passwd(self): 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(uri='/', user=vars.USER_ALICE) request.session['secondary_password'] = cipher.encrypt( @@ -106,19 +106,19 @@ class SecondaryPassword(TestCase): remove_secondary_password(request) self.assertTrue(ldap_md5_crypt.verify('ldaptest', ldap_users( 'alice', - directory=self.ldapobject.directory)[1]['userPassword'][0])) + directory=self.ldapobj.directory)[1]['userPassword'][0])) def test_dont_remove_unknown_hashes_when_removing_secondary_password(self): 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('unknown_hash') - self.ldapobject.directory[ldap_users('alice')[0]][ + self.ldapobj.directory[ldap_users('alice')[0]][ 'userPassword'].append(secondary_password_crypt) request = set_request(uri='/', user=vars.USER_ALICE) request.session['secondary_password'] = cipher.encrypt( secondary_password) remove_secondary_password(request) self.assertIn('unknown_hash', ldap_users( - 'alice', directory=self.ldapobject.directory)[1]['userPassword']) + 'alice', directory=self.ldapobj.directory)[1]['userPassword']) diff --git a/okupy/tests/unit/test_signup.py b/okupy/tests/unit/test_signup.py index 8009546..ac87e05 100644 --- a/okupy/tests/unit/test_signup.py +++ b/okupy/tests/unit/test_signup.py @@ -23,7 +23,7 @@ class SignupUnitTests(OkupyTestCase): 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() @@ -79,9 +79,9 @@ class SignupUnitTests(OkupyTestCase): request = set_request(activate_url, messages=True) activate(request, vars.QUEUEDUSER.encrypted_id) self.assertTrue(ldap_users(vars.QUEUEDUSER.username, - directory=self.ldapobject.directory)) + directory=self.ldapobj.directory)) ldap_account = ldap_users(vars.QUEUEDUSER.username, - directory=self.ldapobject.directory)[1] + directory=self.ldapobj.directory)[1] self.assertEqual(ldap_account['objectClass'], settings.AUTH_LDAP_USER_OBJECTCLASS) self.assertEqual(ldap_account['sn'][0], vars.QUEUEDUSER.last_name) @@ -181,14 +181,14 @@ class SignupUnitTests(OkupyTestCase): def test_add_first_user_in_empty_ldap_directory(self): vars.QUEUEDUSER.save() activate_url = '/activate/%s/' % vars.QUEUEDUSER.encrypted_id - self.ldapobject.directory = ldap_users(clean=True) + self.ldapobj.directory = ldap_users(clean=True) request = set_request(activate_url, messages=True) activate(request, vars.QUEUEDUSER.encrypted_id) self.assertTrue(ldap_users(vars.QUEUEDUSER.username, - directory=self.ldapobject.directory)) + directory=self.ldapobj.directory)) self.assertEqual(ldap_users( vars.QUEUEDUSER.username, - directory=self.ldapobject.directory)[1]['uidNumber'][0], '1') + directory=self.ldapobj.directory)[1]['uidNumber'][0], '1') class SignupunitTestsNoLDAP(OkupyTestCase): -- cgit v1.2.3-65-gdbad From 2f2b1f7df028fb6848b1116e29e92c9bafc535bb Mon Sep 17 00:00:00 2001 From: Pavlos Ratis Date: Fri, 20 Sep 2013 15:41:54 +0300 Subject: delete ldapobj after test execution --- okupy/tests/integration/test_index.py | 1 + okupy/tests/integration/test_lists.py | 1 + okupy/tests/integration/test_login.py | 1 + okupy/tests/integration/test_settings.py | 1 + okupy/tests/integration/test_signup.py | 1 + okupy/tests/unit/test_auth.py | 1 + okupy/tests/unit/test_index.py | 1 + okupy/tests/unit/test_ldapuser.py | 1 + okupy/tests/unit/test_lists.py | 1 + okupy/tests/unit/test_login.py | 1 + okupy/tests/unit/test_secondary_password.py | 1 + okupy/tests/unit/test_signup.py | 1 + 12 files changed, 12 insertions(+) diff --git a/okupy/tests/integration/test_index.py b/okupy/tests/integration/test_index.py index 8444186..b39c074 100644 --- a/okupy/tests/integration/test_index.py +++ b/okupy/tests/integration/test_index.py @@ -20,6 +20,7 @@ class IndexIntegrationTests(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_redirect_to_login_for_anonymous(self): response = self.client.get('/') diff --git a/okupy/tests/integration/test_lists.py b/okupy/tests/integration/test_lists.py index b304b36..0984055 100644 --- a/okupy/tests/integration/test_lists.py +++ b/okupy/tests/integration/test_lists.py @@ -21,6 +21,7 @@ class ListsIntegrationTests(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_devlist_page_uses_correct_template(self): response = self.client.get('/devlist/') diff --git a/okupy/tests/integration/test_login.py b/okupy/tests/integration/test_login.py index 2cd6f17..a799cb0 100644 --- a/okupy/tests/integration/test_login.py +++ b/okupy/tests/integration/test_login.py @@ -21,6 +21,7 @@ class LoginIntegrationTests(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_login_page_uses_correct_template(self): response = self.client.get('/login/') diff --git a/okupy/tests/integration/test_settings.py b/okupy/tests/integration/test_settings.py index 12931ef..531bb40 100644 --- a/okupy/tests/integration/test_settings.py +++ b/okupy/tests/integration/test_settings.py @@ -20,6 +20,7 @@ class SettingsIntegrationTests(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_profile_settings_page_uses_correct_template(self): response = self.client.post('/login/', vars.LOGIN_ALICE) diff --git a/okupy/tests/integration/test_signup.py b/okupy/tests/integration/test_signup.py index e848a0b..240ef98 100644 --- a/okupy/tests/integration/test_signup.py +++ b/okupy/tests/integration/test_signup.py @@ -20,6 +20,7 @@ class SignupIntegrationTests(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_signup_page_uses_correct_template(self): response = self.client.get('/signup/') diff --git a/okupy/tests/unit/test_auth.py b/okupy/tests/unit/test_auth.py index a5b005c..4618bba 100644 --- a/okupy/tests/unit/test_auth.py +++ b/okupy/tests/unit/test_auth.py @@ -25,6 +25,7 @@ class AuthSSLUnitTests(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_valid_certificate_authenticates_alice(self): request = set_request(uri='/login') diff --git a/okupy/tests/unit/test_index.py b/okupy/tests/unit/test_index.py index e85df7e..352a7ef 100644 --- a/okupy/tests/unit/test_index.py +++ b/okupy/tests/unit/test_index.py @@ -22,6 +22,7 @@ class IndexUnitTests(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_index_url_resolves_to_index_view(self): found = resolve('/') diff --git a/okupy/tests/unit/test_ldapuser.py b/okupy/tests/unit/test_ldapuser.py index 82ba5c4..7a5665f 100644 --- a/okupy/tests/unit/test_ldapuser.py +++ b/okupy/tests/unit/test_ldapuser.py @@ -29,6 +29,7 @@ class LDAPUserUnitTests(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_return_unicode_username(self): alice = LDAPUser.objects.get(username='alice') diff --git a/okupy/tests/unit/test_lists.py b/okupy/tests/unit/test_lists.py index ca0f74f..783792b 100644 --- a/okupy/tests/unit/test_lists.py +++ b/okupy/tests/unit/test_lists.py @@ -21,6 +21,7 @@ class ListsUnitTests(OkupyTestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_devlist_url_resolves_to_lists_view(self): found = resolve('/devlist/') diff --git a/okupy/tests/unit/test_login.py b/okupy/tests/unit/test_login.py index c2acaa2..ad4905a 100644 --- a/okupy/tests/unit/test_login.py +++ b/okupy/tests/unit/test_login.py @@ -31,6 +31,7 @@ class LoginUnitTests(OkupyTestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_incorrect_user_raises_login_failed(self): request = set_request(uri='/login', post=vars.LOGIN_WRONG, diff --git a/okupy/tests/unit/test_secondary_password.py b/okupy/tests/unit/test_secondary_password.py index b9fbc38..73b574b 100644 --- a/okupy/tests/unit/test_secondary_password.py +++ b/okupy/tests/unit/test_secondary_password.py @@ -26,6 +26,7 @@ class SecondaryPassword(TestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_secondary_password_gets_added_in_session(self): request = set_request(uri='/', user=vars.USER_ALICE) diff --git a/okupy/tests/unit/test_signup.py b/okupy/tests/unit/test_signup.py index ac87e05..c0ca1ea 100644 --- a/okupy/tests/unit/test_signup.py +++ b/okupy/tests/unit/test_signup.py @@ -27,6 +27,7 @@ class SignupUnitTests(OkupyTestCase): def tearDown(self): self.mockldap.stop() + del self.ldapobj def test_username_already_exists_in_ldap(self): _form = vars.SIGNUP_TESTUSER.copy() -- cgit v1.2.3-65-gdbad From fba5fabffc64d4f97f960bbf9b4f53638c32ef2b Mon Sep 17 00:00:00 2001 From: Pavlos Ratis Date: Fri, 20 Sep 2013 16:11:23 +0300 Subject: add tearDownClass --- okupy/tests/integration/test_index.py | 4 ++++ okupy/tests/integration/test_lists.py | 4 ++++ okupy/tests/integration/test_login.py | 4 ++++ okupy/tests/integration/test_settings.py | 4 ++++ okupy/tests/integration/test_signup.py | 4 ++++ okupy/tests/unit/test_auth.py | 4 ++++ okupy/tests/unit/test_index.py | 4 ++++ okupy/tests/unit/test_ldapuser.py | 4 ++++ okupy/tests/unit/test_lists.py | 4 ++++ okupy/tests/unit/test_login.py | 4 ++++ okupy/tests/unit/test_secondary_password.py | 4 ++++ okupy/tests/unit/test_signup.py | 4 ++++ 12 files changed, 48 insertions(+) diff --git a/okupy/tests/integration/test_index.py b/okupy/tests/integration/test_index.py index b39c074..cec706d 100644 --- a/okupy/tests/integration/test_index.py +++ b/okupy/tests/integration/test_index.py @@ -13,6 +13,10 @@ class IndexIntegrationTests(TestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.client = Client() self.mockldap.start() diff --git a/okupy/tests/integration/test_lists.py b/okupy/tests/integration/test_lists.py index 0984055..e6360a9 100644 --- a/okupy/tests/integration/test_lists.py +++ b/okupy/tests/integration/test_lists.py @@ -14,6 +14,10 @@ class ListsIntegrationTests(TestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.client = Client() self.mockldap.start() diff --git a/okupy/tests/integration/test_login.py b/okupy/tests/integration/test_login.py index a799cb0..378c2e9 100644 --- a/okupy/tests/integration/test_login.py +++ b/okupy/tests/integration/test_login.py @@ -23,6 +23,10 @@ class LoginIntegrationTests(TestCase): self.mockldap.stop() del self.ldapobj + @classmethod + def tearDownClass(cls): + del cls.mockldap + def test_login_page_uses_correct_template(self): response = self.client.get('/login/') self.assertTemplateUsed(response, 'base.html') diff --git a/okupy/tests/integration/test_settings.py b/okupy/tests/integration/test_settings.py index 531bb40..94ef620 100644 --- a/okupy/tests/integration/test_settings.py +++ b/okupy/tests/integration/test_settings.py @@ -13,6 +13,10 @@ class SettingsIntegrationTests(TestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.client = Client() self.mockldap.start() diff --git a/okupy/tests/integration/test_signup.py b/okupy/tests/integration/test_signup.py index 240ef98..64e8d50 100644 --- a/okupy/tests/integration/test_signup.py +++ b/okupy/tests/integration/test_signup.py @@ -13,6 +13,10 @@ class SignupIntegrationTests(TestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.client = Client() self.mockldap.start() diff --git a/okupy/tests/unit/test_auth.py b/okupy/tests/unit/test_auth.py index 4618bba..586987b 100644 --- a/okupy/tests/unit/test_auth.py +++ b/okupy/tests/unit/test_auth.py @@ -19,6 +19,10 @@ class AuthSSLUnitTests(TestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.mockldap.start() self.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI] diff --git a/okupy/tests/unit/test_index.py b/okupy/tests/unit/test_index.py index 352a7ef..9f71230 100644 --- a/okupy/tests/unit/test_index.py +++ b/okupy/tests/unit/test_index.py @@ -16,6 +16,10 @@ class IndexUnitTests(TestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.mockldap.start() self.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI] diff --git a/okupy/tests/unit/test_ldapuser.py b/okupy/tests/unit/test_ldapuser.py index 7a5665f..4ca821f 100644 --- a/okupy/tests/unit/test_ldapuser.py +++ b/okupy/tests/unit/test_ldapuser.py @@ -23,6 +23,10 @@ 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.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI] diff --git a/okupy/tests/unit/test_lists.py b/okupy/tests/unit/test_lists.py index 783792b..8cdcb6f 100644 --- a/okupy/tests/unit/test_lists.py +++ b/okupy/tests/unit/test_lists.py @@ -15,6 +15,10 @@ class ListsUnitTests(OkupyTestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.mockldap.start() self.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI] diff --git a/okupy/tests/unit/test_login.py b/okupy/tests/unit/test_login.py index ad4905a..f781741 100644 --- a/okupy/tests/unit/test_login.py +++ b/okupy/tests/unit/test_login.py @@ -25,6 +25,10 @@ class LoginUnitTests(OkupyTestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.mockldap.start() self.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI] diff --git a/okupy/tests/unit/test_secondary_password.py b/okupy/tests/unit/test_secondary_password.py index 73b574b..62c9890 100644 --- a/okupy/tests/unit/test_secondary_password.py +++ b/okupy/tests/unit/test_secondary_password.py @@ -20,6 +20,10 @@ class SecondaryPassword(TestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.mockldap.start() self.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI] diff --git a/okupy/tests/unit/test_signup.py b/okupy/tests/unit/test_signup.py index c0ca1ea..dc43c74 100644 --- a/okupy/tests/unit/test_signup.py +++ b/okupy/tests/unit/test_signup.py @@ -21,6 +21,10 @@ class SignupUnitTests(OkupyTestCase): def setUpClass(cls): cls.mockldap = MockLdap(vars.DIRECTORY) + @classmethod + def tearDownClass(cls): + del cls.mockldap + def setUp(self): self.mockldap.start() self.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI] -- cgit v1.2.3-65-gdbad