def METHOD_NAME(request, avrae):
    """Sets up an active character in the user's context, to be used in tests. Cleans up after itself."""
    filename = os.path.join(dir_path, "static", f"char-{request.param}.json")
    with open(filename) as f:
        char = Character.from_dict(json.load(f))
    char.owner = DEFAULT_USER_ID
    char._active = True
    avrae.mdb.characters.delegate.update_one(
        {"owner": char.owner, "upstream": char.upstream}, {"$set": char.to_dict()}, upsert=True
    )
    if request.cls is not None:
        request.cls.METHOD_NAME = char
    yield char
    avrae.mdb.characters.delegate.delete_one({"owner": char.owner, "upstream": char.upstream})
    # noinspection PyProtectedMember
    Character._cache.clear()