fix(tests): Do not test order of features in Location (#17983)
fix(tests): Do not test order of features in Location
This commit is contained in:
commit
903d5201b4
@ -25,9 +25,12 @@ class TestLocation(unittest.TestCase):
|
||||
temp['features'][0]['properties']['feature_of'] = location
|
||||
formatted_locations.extend(temp['features'])
|
||||
|
||||
formatted_location_string = str(formatted_locations)
|
||||
test_location = frappe.get_doc('Location', 'Test Location Area')
|
||||
test_location.save()
|
||||
|
||||
self.assertEqual(formatted_location_string, str(json.loads(test_location.get('location'))['features']))
|
||||
test_location_features = json.loads(test_location.get('location'))['features']
|
||||
ordered_test_location_features = sorted(test_location_features, key=lambda x: x['properties']['feature_of'])
|
||||
ordered_formatted_locations = sorted(formatted_locations, key=lambda x: x['properties']['feature_of'])
|
||||
|
||||
self.assertEqual(ordered_formatted_locations, ordered_test_location_features)
|
||||
self.assertEqual(area, test_location.get('area'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user