'Tries to create an encrypted field with a mode mismatch.
A purpose of "DECRYPT_AND_ENCRYPT" cannot be used with a public key,
since public keys cannot be used for decryption. This should raise an
exception.'

@run_if_active
def testUnacceptablePurpose(self):

    with self.assertRaises(keyczar.errors.KeyczarError):
        with keys(keyinfo.ENCRYPT):
            with secret_model():
                pass
