Skip to content

Commit

Permalink
Merge pull request #33981 from dimagi/ze/fix-failing-geospatial-test
Browse files Browse the repository at this point in the history
Fix Inconsistent Ordering on Geospatial Test
  • Loading branch information
zandre-eng committed Jan 16, 2024
2 parents 6a42a59 + 4d49e65 commit 91d5f1c
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions corehq/apps/geospatial/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,23 +335,24 @@ def tearDownClass(cls):
super().tearDownClass()

def test_get_users_with_gps(self):
expected_output = {
'user_data': [
{
'id': self.user_a.user_id,
'username': self.user_a.raw_username,
'gps_point': '12.34 45.67',
},
{
'id': self.user_c.user_id,
'username': self.user_c.raw_username,
'gps_point': '45.67 12.34',
},
],
expected_results = {
self.user_a.user_id: {
'id': self.user_a.user_id,
'username': self.user_a.raw_username,
'gps_point': '12.34 45.67',
},
self.user_c.user_id: {
'id': self.user_c.user_id,
'username': self.user_c.raw_username,
'gps_point': '45.67 12.34',
}
}
self.client.login(username=self.username, password=self.password)
response = self.client.get(self.endpoint)
self.assertEqual(response.json(), expected_output)
response_json = response.json()
self.assertIn('user_data', response_json)
user_data = {user['id']: user for user in response_json['user_data']}
self.assertEqual(user_data, expected_results)

def test_get_location_filtered_users(self):
self.client.login(username=self.username, password=self.password)
Expand Down

0 comments on commit 91d5f1c

Please sign in to comment.