-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Resolve default ordering warnings from tests #3820
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
Resolve default ordering warnings from tests #3820
Conversation
Build failed.
|
3da9991
to
e8a0bf1
Compare
Build succeeded.
|
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.
Thank you for this! All of the order_by's make sense.
@@ -4448,6 +4452,7 @@ class RoleUsersList(SubListAttachDetachAPIView): | |||
serializer_class = serializers.UserSerializer | |||
parent_model = models.Role | |||
relationship = 'members' | |||
ordering = ('username',) |
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.
We could alternatively do this on the model, which would be more concise.
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.
I agree entirely for the OAuth2 models, because we maintain those. Pushed a commit that does this.
But we don't have a User model inside of our app, so I want to keep these for that model, and only that model.
e8a0bf1
to
a8cce4f
Compare
Build succeeded.
|
Blocked, as the migration claim is not settled |
This is probably unblocked once something like #3842 is merged. |
Not blocked anymore 👀 |
a8cce4f
to
867cf8d
Compare
Build failed.
|
867cf8d
to
f4c1884
Compare
Build succeeded.
|
Got test output, and only remaining warning is:
From some googling on this problem, it might be platform-specific, and anyway, it's probably harmless and related to the python stdlib logging. |
Build succeeded (gate pipeline).
|
SUMMARY
The tests were giving warnings
There were a lot of them. After this there should be none.
ISSUE TYPE
COMPONENT NAME
AWX VERSION
ADDITIONAL INFORMATION
In some cases, we can't modify the
Meta
of the model, because it is not our model.Because of that, I borrowed the closest thing to the standard pattern from DRF:
https://github.com/encode/django-rest-framework/blob/14fad0d6902550cd61fc07370759ef785effa207/rest_framework/filters.py#L186-L190
So when you see the
ordering
parameter set on a view, you should know that I did not invent that.