Skip to content

Commit 7ac0867

Browse files
committed
fix tests to work with enum-properties < 1.5 as well
1 parent e913cdc commit 7ac0867

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

django_enum/tests/tests.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2118,9 +2118,14 @@ class EmptyEqEnum(TextChoices, s('prop', case_fold=True)):
21182118
"empty_value set."
21192119
)
21202120

2121+
# version 1.5.0 of enum_properties changed the default symmetricity
2122+
# of none values.
2123+
from enum_properties import VERSION
2124+
match_none = {} if VERSION < (1, 5, 0) else {'match_none': True}
2125+
21212126
class EmptyEqEnum2(
21222127
TextChoices,
2123-
s('prop', case_fold=True, match_none=True)
2128+
s('prop', case_fold=True, **match_none)
21242129
):
21252130

21262131
A = 'A', [None, '', ()]

0 commit comments

Comments
 (0)