Closed ramnes closed 1 year ago
I looked into issue more closely – pymongo and mongomock actually work well with str-like classes (as I can tell), so issues are with interaction between mongomock and beanie's internals. Instead of adding this edge cases, I decided to add only ExpressionField as single edge case for now
You can checkout #23, and if everything's ok, I'll merge it, and close this one
The current implementation of
_normalize_strings
transforms enum members into their representation, when it should give their value instead.For example, with such an enum
a cursor like
Cursor({"importance": Importance.HIGH})
would see its filter transformed to{"importance": "Importance.HIGH"}
instead of{"importance": "high"}
, which will most likely not fetch anything.