diff options
Diffstat (limited to 'okupy')
-rw-r--r-- | okupy/tests/integration/test_index.py | 2 | ||||
-rw-r--r-- | okupy/tests/integration/test_lists.py | 2 | ||||
-rw-r--r-- | okupy/tests/integration/test_login.py | 2 | ||||
-rw-r--r-- | okupy/tests/integration/test_settings.py | 2 | ||||
-rw-r--r-- | okupy/tests/integration/test_signup.py | 2 | ||||
-rw-r--r-- | okupy/tests/unit/test_auth.py | 4 | ||||
-rw-r--r-- | okupy/tests/unit/test_index.py | 2 | ||||
-rw-r--r-- | okupy/tests/unit/test_ldapuser.py | 8 | ||||
-rw-r--r-- | okupy/tests/unit/test_lists.py | 2 | ||||
-rw-r--r-- | okupy/tests/unit/test_login.py | 8 | ||||
-rw-r--r-- | okupy/tests/unit/test_secondary_password.py | 34 | ||||
-rw-r--r-- | 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): |