[server] drop system_source_cnx for a simpler internal API
system_source_cnx() can be replaced with source_cnx().
If system_source_cnx() is called with dbms_system_base=False, it is
strictly equivalent to calling source_cnx() with the same source,
privileges and interactivity.
If system_source_cnx() is called with dbms_system_base=True, it is
equivalent to calling source_cnx() with the system database and the
same source, privileges and interactivity.
No use of the default value for 'special_privs' was found in the code.
from unittest import TestCase
from cubicweb import crypto
class CryptoTC(TestCase):
def test_encrypt_decrypt_roundtrip(self):
data = {'a': u'ah', 'b': [1, 2]}
seed = 's' * 16
crypted = crypto.encrypt(data, seed)
decrypted = crypto.decrypt(crypted, seed)
self.assertEqual(decrypted, data)
if __name__ == '__main__':
import unittest
unittest.main()