def test_secret_encryption(self): assert conf.get(ENCRYPTION_KEY) == 'my_key' assert conf.get(ENCRYPTION_SECRET ) == 'qMGwKR21SAjprV0XOJUI4SoI-MLFoTxN1ahZndKREL4=' encryptor.validate() encryptor.setup() value = 'foo' encrypted_value = encryptor.encrypt(value) assert encrypted_value.startswith('{}my_key$'.format( EncryptionManager.MARKER)) assert encryptor.decrypt(encrypted_value) == 'foo'
def setup_encryptor_service(self) -> None: import encryptor encryptor.validate() encryptor.setup()