def test_string_encryption(self): key = service.create_aes_key() data = 'Hello, Im Data' edata = service.encrypt_attr_value(data, key) self.assertEqual( utils.to_string(service.decrypt_attr_value(edata, key)), data )
def setUp(self): self.key = service.create_aes_key() self.data = 'hoôray!🎉'
def test_bytes_encryption(self): key = service.create_aes_key() data = b'Hello, Im Data' edata = service.encrypt_attr_value(data, key) self.assertEqual(service.decrypt_attr_value(edata, key), data)
def test_string_encryption(self): key = service.create_aes_key() data = 'Hello, Im Data' edata = service.encrypt_attr_value(data, key) self.assertEqual( utils.to_string(service.decrypt_attr_value(edata, key)), data)