Skip to content

Commit

Permalink
Make test resilient ot explicit ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
niconoe committed Jul 23, 2024
1 parent b1b182f commit 4aeead7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dashboard/tests/views/test_public_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_observation_json_short_results(self):
response = self.client.get(f"{base_url}?limit=10&page_number=1&mode=short")
self.assertEqual(response.status_code, 200)
json_data = response.json()
expected = [
expected_data = [
{
"id": self.obs1.pk,
"lat": 50.48940999999999,
Expand All @@ -222,7 +222,8 @@ def test_observation_json_short_results(self):
"date": "2021-10-08",
},
]
self.assertEqual(json_data["results"], expected)
for expected in expected_data:
self.assertIn(expected, json_data["results"])

def test_observations_json_default_mode_normal(self):
"""Explicitly asking the normal mode brings the same result as not specifying a mode"""
Expand Down

0 comments on commit 4aeead7

Please sign in to comment.