[1.7.x] Fixed #22537 -- Add tests and improved docs for field subclass with choices.

Backport of 7fd1b35ed7 from master