payment.py
392 Bytes
import unittest
import json
from linkaja.crypt.payment import Crypt
class Coba(unittest.TestCase):
def test_encrypt(self):
d = dict(invoice_id='1234')
raw1 = json.dumps(d)
key = '1234'
c = Crypt(key)
crypted = c.encrypt(raw1)
raw2 = c.decrypt(crypted)
self.assertEqual(raw1, raw2)
if __name__ == '__main__':
unittest.main()