def METHOD_NAME(conn, val, wrapper, fmt_in):
    wrapper = getattr(psycopg.types.json, wrapper)
    obj = json.loads(val)
    cur = conn.cursor()
    cur.execute(
        f"select %{fmt_in.value}::text = %s::{wrapper.__name__.lower()}::text",
        (wrapper(obj), val),
    )
    assert cur.fetchone()[0] is True