'Uses a private key to encrypt data, but decryption is not allowed.
ENCRYPTED_FIELD_MODE is explicitly set to ENCRYPT, meaning data should
not be decrypted, even though the key would allow for it.'

@run_if_active
def testDecryptionForbidden(self):

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