예제 #1
0
파일: tests.py 프로젝트: grnet/synnefo
 def test_password_change(self):
     from synnefo.db import aes_encrypt as aes
     old_pass = aes.SECRET_ENCRYPTION_KEY
     old = 'bar'
     encrypted = aes.encrypt_db_charfield(old)
     aes.SECRET_ENCRYPTION_KEY = 'foo2'
     self.assertRaises(aes.CorruptedPassword, aes.decrypt_db_charfield,
                       encrypted)
     aes.SECRET_ENCRYPTION_KEY = old_pass
     new = aes.decrypt_db_charfield(encrypted)
     self.assertEqual(old, new)
예제 #2
0
 def test_password_change(self):
     from synnefo.db import aes_encrypt as aes
     old_pass = aes.SECRET_ENCRYPTION_KEY
     old = 'bar'
     encrypted = aes.encrypt_db_charfield(old)
     aes.SECRET_ENCRYPTION_KEY = 'foo2'
     self.assertRaises(aes.CorruptedPassword, aes.decrypt_db_charfield,
                       encrypted)
     aes.SECRET_ENCRYPTION_KEY = old_pass
     new = aes.decrypt_db_charfield(encrypted)
     self.assertEqual(old, new)
예제 #3
0
파일: tests.py 프로젝트: grnet/synnefo
 def test_encrypt_decrtypt(self):
     from synnefo.db import aes_encrypt as aes
     old = 'bar'
     new = aes.decrypt_db_charfield(aes.encrypt_db_charfield(old))
     self.assertEqual(old, new)
예제 #4
0
 def test_encrypt_decrtypt(self):
     from synnefo.db import aes_encrypt as aes
     old = 'bar'
     new = aes.decrypt_db_charfield(aes.encrypt_db_charfield(old))
     self.assertEqual(old, new)