'Uses a public key to encrypt, and a private key to decrypt data.'

def test_encrypt_public_decrypt_private(self):

    test_val = 'Test    Secret'
    with keys(keyinfo.ENCRYPT, mode=keyinfo.ENCRYPT.name):
        with secret_model() as model:
            secret = model.objects.create(name=test_val)
            enc_retrieved_secret = model.objects.get(id=secret.id)
            self.assertNotEqual(test_val, enc_retrieved_secret.name)
            self.assertTrue(enc_retrieved_secret.name.startswith(EncryptedCharField.prefix))
    with keys(keyinfo.DECRYPT_AND_ENCRYPT):
        with secret_model() as model:
            retrieved_secret = model.objects.get(id=secret.id)
            self.assertEqual(test_val, retrieved_secret.name)
