Пример #1
0
 def test_encrypt_without_bsn_decrypt_bsn(self):
     """ test encryption with bsn, but decryption without bsn verification. """
     value = "abcdefg"
     bsn = "12345678"
     enc = encrypt(value)
     with self.assertRaises(InvalidToken):
         self.assertEqual(decrypt(enc, bsn), value)
Пример #2
0
 def test_encrypt_bsn_decrypt_without_bsn(self):
     """ test encryption with bsn, but decryption without bsn verification. """
     value = "abcdefg"
     bsn = "12345678"
     enc = encrypt(value, bsn)
     self.assertEqual(decrypt(enc), value)
Пример #3
0
 def test_encrypt_decrypt_bsn(self):
     value = "abcdefg"
     bsn = "12345678"
     enc = encrypt(value, bsn)
     self.assertEqual(decrypt(enc, bsn), value)
     pass
Пример #4
0
 def test_encrypt_decrypt_bsn_invalid(self):
     value = "abcdefg"
     bsn = "12345678"
     enc = encrypt(value, bsn)
     with self.assertRaises(InvalidToken):
         self.assertEqual(decrypt(enc, "2345"), value)
Пример #5
0
 def test_encrypt_decrypt(self):
     value = "abcdefg"
     enc = encrypt(value)
     self.assertEqual(decrypt(enc), value)