def test_should_raise_ImproperlyConfigured_if_ENCRYPTED_FIELD_KEYS_DIR_is_not_set( self): # noqa with self.assertRaisesRegexp( ImproperlyConfigured, 'You must set the settings.ENCRYPTED_FIELD_KEYS_DIR setting to your Keyczar keys directory' ): # noqa BaseEncryptedField()
def test_should_raise_ImproperlyConfigured_if_invalid_ENCRYPTED_FIELD_MODE_is_set( self): # noqa with self.assertRaisesRegexp( ImproperlyConfigured, 'ENCRYPTED_FIELD_MODE must be either DECRYPT_AND_ENCRYPT or ENCRYPT, not INVALID.' ): # noqa BaseEncryptedField()
def test_should_raise_ImproperlyConfigured_if_invalid_ENCRYPTED_FIELD_MODE_is_set( self): with override_settings(ENCRYPTED_FIELD_KEYS_DIR=self.tmpdir, ENCRYPTED_FIELD_MODE='INVALID'): with self.assertRaisesRegexp( ImproperlyConfigured, 'ENCRYPTED_FIELD_MODE must be either DECRYPT_AND_ENCRYPT or ENCRYPT, not INVALID.' ): BaseEncryptedField()