def to_python(self, value):
        if not value:
            return dict()
        try:
            if (isinstance(value, basestring) or
                    type(value) is unicode):
                return json.loads(value)
        except ValueError:
            return dict()
        return value
Test that an InvalidField error is raised when creating an asymmetric
dataset/ETHPy150Open mozilla/django-badger/badger/models.py/JSONField.to_python--crossover with--dataset/ETHPy150Open OpenKMIP/PyKMIP/kmip/tests/unit/services/server/crypto/test_engine.py/TestCryptographyEngine.test_create_asymmetric_key_with_invalid_algorithm