How to Make It
Combine beans, 2 tablespoons oil, 1 1/2 teaspoons vinegar, garlic, 1/2 teaspoon salt, and chopped thyme in a high-powered blender. Process until mixture is smooth and has the texture of hummus, adding water, 1 teaspoon at a time, if mixture is too thick, until desired consistency is reached, about 30 seconds. Set aside.
Heat 1 tablespoon oil in a medium saucepan over medium-high. Add onions; cook, stirring occasionally, until browned, about 5 minutes. Reduce heat to medium; add sugar and 1/4 teaspoon salt. Cook, stirring constantly, until sugar starts to melt, about 20 seconds. Add stock; cook, stirring occasionally, until liquid is reduced by half and onions have softened, about 6 minutes. Stir in wine; cook, stirring occasionally, until liquid is reduced by half, about 6 minutes. Stir in remaining 1 tablespoon vinegar; cook, stirring occasionally, until sauce is syrupy, liquid is reduced to about 3 tablespoons, and onions are glazed, 14 to 16 minutes. Remove from heat; cover to keep warm.
Heat 1 tablespoon oil in a large cast-iron skillet over medium-high. Add just enough mushrooms to cover bottom of skillet (about one-third of mushrooms). Cook, undisturbed, until bottoms are golden brown, 2 to 3 minutes. Flip and cook until softened, 2 to 3 minutes. Transfer to a bowl. Repeat procedure twice with remaining 2 tablespoons oil and remaining mushrooms. Toss cooked mushrooms with pepper and remaining 1/4 teaspoon salt.
Spread bean mixture evenly over toasted bread slices. Top each slice with about 1/4 cup onions and 1/2 cup mushrooms. Drizzle tartines evenly with onion glaze; sprinkle with thyme leaves.