#11 passwords are now stored with aes-128 encryption

This commit is contained in:
Uwe Kamper 2013-10-27 21:13:41 +01:00
parent 6bc87b605c
commit 5e29478516
6 changed files with 103 additions and 18 deletions

View file

@ -6,11 +6,24 @@ Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from account.views import encrypt_ldap_password, decrypt_ldap_password
class CbmiTest(TestCase):
"""
Test for the cbmi apps.
"""
TEST_LDAP_PASSWD = 'correcthorsebatterystaple'
def encrypt_it(self):
return encrypt_ldap_password(self.TEST_LDAP_PASSWD)
def test_encrypt_ldap_password(self):
message, key = self.encrypt_it()
print 'key:', key
print 'message:', message
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
def test_decrypt_ldap_password(self):
message, key = self.encrypt_it()
decrypted = decrypt_ldap_password(message, key)
self.assertEqual(self.TEST_LDAP_PASSWD, decrypted)