Black potions are either oil, ink or a random potion. Purple-red potions are either wine or a random potion.
When you pick one up from the dungeon, click Knowledge. If it says, "You can't tell black/purple-red potions apart" it is either oil, ink or wine, depending on the color.
Be careful doing this with a stack of potions, as it will only apply to the top potion. You can knowledge, then drop a potion, then knowledge, until you run out the stack.
This is important because it identifies a weak potion (wine) and it narrows down a weak potion and a strong potion (oil and ink).
If either of the random potions is an expensive potion, you can pass all the potions off as this expensive potion so long as everything is unidentified. To do this, separate your two potions onto the floor. Pick up all of your potions of oil/ink/wine. Then pick up one expensive potion and make the sale.
Because many expensive potions are good, this exploit is best used when you have already identified Enlightenment, Gain Ability, Polymorph and Full Healing.