-
-
Notifications
You must be signed in to change notification settings - Fork 7k
fix: MultipleChoiceField use ordered sort #9735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also add unit tests to verify this and make the CI green
I’ve added the tests and the CI is green now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sensible to me 👍🏻
However, it will have to wait for 3.17 as I see this as potentially disruptive for some downstream users. Left a small suggestion
@@ -199,14 +199,14 @@ def test_nested_serializer_with_list_json(self): | |||
serializer = self.Serializer(data=input_data) | |||
|
|||
assert serializer.is_valid() | |||
assert serializer.validated_data['nested']['example'] == {1, 2} | |||
assert serializer.validated_data['nested']['example'] == [1, 2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, that's a bit unfortunate that this data type is exposed at this level. I'm thinking of potential users testing at the serializer level might get some new test failures with this change.
Good point — waiting for 3.17 sounds like the right call. Appreciate the suggestion! |
This modification has the following advantages: