def METHOD_NAME():
    """
    Ensure that a tagged string that is not in the ``enum`` list is properly handled.
    """
    with asdf.config_context() as conf:
        conf.add_resource_mapping({TAGGED_UNIT_URI: TAGGED_UNIT_SCHEMA})
        schema = asdf.schema.load_schema(TAGGED_UNIT_URI)
        # This should not raise an exception (check_schema will raise error)
        asdf.schema.check_schema(schema)
        unit = TaggedString("foo")
        unit._tag = ASDF_UNIT_TAG
        with pytest.raises(asdf.ValidationError, match=r"'foo' is not one of \['m', 'kg'\]"):
            asdf.schema.validate({"unit": unit}, schema=schema)