-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EnumFieldMixin.get_choices for enum34 1.1
On Python 2 with enum34 version 1.1.0 or newer, an enum item with zero value will evaluate to false. This makes `get_choices` return incorrect data for the zero item. Fix this by doing the checking if a choice is an enum value with `if isinstance(i, Enum)` rather than with `if i`. Add a test case that checks the choices are correct.
- Loading branch information
1 parent
dc7ffd8
commit 7ec7d61
Showing
4 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters