Fixes IndexError on save with removed member forwarding email (#11)
* Fixed IndexError if a non existent field gets queried for a value. Using dict.get to either get a value or provide a reasonable default * Removed list construction around new_key value * Clean up source code with 80x25 terminal and vim (complies with PEP-8) * Added some docstrings
This commit is contained in:
parent
4f093c0899
commit
09af25761c
7 changed files with 409 additions and 194 deletions
|
|
@ -6,7 +6,9 @@ Replace this with more appropriate tests for your application.
|
|||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
from password_encryption import encrypt_ldap_password, decrypt_ldap_password
|
||||
from account.password_encryption import encrypt_ldap_password, \
|
||||
decrypt_ldap_password
|
||||
|
||||
|
||||
class PasswordEncryptionTest(TestCase):
|
||||
"""
|
||||
|
|
@ -22,8 +24,7 @@ class PasswordEncryptionTest(TestCase):
|
|||
print('key:', key)
|
||||
print('message:', message)
|
||||
|
||||
|
||||
def test_decrypt_ldap_password(self):
|
||||
message, key = self.encrypt_it()
|
||||
decrypted = decrypt_ldap_password(message, key)
|
||||
self.assertEqual(self.TEST_LDAP_PASSWD, decrypted)
|
||||
self.assertEqual(self.TEST_LDAP_PASSWD, decrypted)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue