🚨(backend) fix Django UnorderedObjectListWarning on models

Found this solution googling on Stack Overflow.

Without a default ordering on a model, Django raises a warning, that
pagination may yield inconsistent results.
This commit is contained in:
lebaudantoine
2024-12-31 11:32:21 +01:00
committed by aleb_the_flash
parent 7f8a6e8685
commit 3282da7c56
2 changed files with 3 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ def test_api_users_list_query_email():
assert response.status_code == 200
user_ids = [user["id"] for user in response.json()["results"]]
assert user_ids == [str(nicole.id), str(frank.id)]
assert user_ids == [str(frank.id), str(nicole.id)]
def test_api_users_retrieve_me_anonymous():