'Uses a private key to encrypt data on model creation.
Verifies the data is decrypted when reading the value back from the
model.'

@run_if_active
def testTextFieldRead(self):

    with keys(keyinfo.DECRYPT_AND_ENCRYPT):
        with secret_model() as model:
            test_val = 'Test    Secret'
            secret = model.objects.create(text=test_val)
            retrieved_secret = model.objects.get(id=secret.id)
            self.assertEqual(test_val, retrieved_secret.text)
