To check or test old-fashioned magnetic headphones use a very small battery, a 1.5V AAA cell is fine -- or just use an adaptor and plug them into your iPod. Important Note, if it says "Brush" or "Clevite" on your headphones, they are crystal headphones and will be ruined by any DC-type test. Check the label. Most Brush headphones have octagonal instead of cylindrical backs and a cast-in label.
Really old ones with tip plugs on the ends of the leads will often "click" just from touching the tips together in a damp palm. (The tip plating was porous -- so, brass, nickel, a little salt water, you get a current flow).
The adapter/iPod trick may be okay for even Brush-Clevite crystal headphones, I don't know and would not advise it. If you're an electronics type, a series condenser, say .01 or .05 mF, would make it safer. A 1:1 transformer might be even better -- 600:600 ohms, like a coupling transformer from an old modem, would do. (I've ruined a Brush earpiece plugging into the headphone jack on a reel-to-reel, so trust me and be careful).
Someone, malicious or ill-informed, is going around on eBay, asking headphone sellers to use a nine volt battery to "test" them. Please don't do this. It can do damage to some types. The wire used for the windings is tiny and can be melted by excessive current. Use a 1.5 Volt cell at most. Or use an ohmmeter; the current will be limited. Anything other than open or dead short indicates some degree of function.
Another thing -- if you're selling headphones on an auction site, why oh why would you unscrew the caps and take the diaphragms out? There's a permanent magnet in there, one with some oomph, and it will grab any little ferrous particles around. They'll get between the pole pieces and the diaphragm and make for trouble. The diaphragms themselves are a bit fragile; bend 'em and they are ruined. Last of all, the caps -- and often but not always the backs or "cups" -- are brittle Bakelite or hard rubber. They can chip, jam and break when unscrewed or dropped.
Be nice to old-style headphones. They will never make balanced-armature, mica-diaphraghm Baldwins (very complex inside) ever again. You will not find new Brush-Clevite cans (with their high-fidelity sound -- hams even used them as microphones) and the last stocks of Trimm "Commercial,*" "Professional*" and even the ubiquitous "Dependable" model ran out decades ago. What we have is all we'll have. Every set you break is gone. (But save the parts! Sometimes three broken sets add up to one working pair).
Related, Modern Radio Labs sells the definitive handbook on maintenance and repair of old headphones. It's worth owning.
* Highly recommended. My fave set of radio "cans" for years have been Commercials. Trimm's little "Featherweights" are nice, too.