Skip to content

Commit fd1faab

Browse files
committed
[fix] Resolve conflicts and increased queries based on recent changes to geo_api:device_location
1 parent 7580cdc commit fd1faab

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

openwisp_controller/geo/tests/test_api.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ def test_create_devicelocation_using_related_ids(self):
724724
floorplan = self._create_floorplan()
725725
location = floorplan.location
726726
url = reverse("geo_api:device_location", args=[device.id])
727-
with self.assertNumQueries(26):
727+
with self.assertNumQueries(29):
728728
response = self.client.put(
729729
url,
730730
data={
@@ -762,7 +762,7 @@ def test_create_devicelocation_location_floorplan(self):
762762
"floorplan.image": self._get_simpleuploadedfile(),
763763
"indoor": ["12.342,23.541"],
764764
}
765-
with self.assertNumQueries(40):
765+
with self.assertNumQueries(43):
766766
response = self.client.put(
767767
url, encode_multipart(BOUNDARY, data), content_type=MULTIPART_CONTENT
768768
)
@@ -829,7 +829,7 @@ def test_create_devicelocation_only_location(self):
829829
"type": "indoor",
830830
}
831831
}
832-
with self.assertNumQueries(29):
832+
with self.assertNumQueries(32):
833833
response = self.client.put(url, data=data, content_type='application/json')
834834
self.assertEqual(response.status_code, 201)
835835
self.assertEqual(self.location_model.objects.count(), 1)
@@ -869,7 +869,7 @@ def test_create_devicelocation_existing_location_new_floorplan(self):
869869
"floorplan.image": self._get_simpleuploadedfile(),
870870
"indoor": ["12.342,23.541"],
871871
}
872-
with self.assertNumQueries(34):
872+
with self.assertNumQueries(37):
873873
response = self.client.put(
874874
url, encode_multipart(BOUNDARY, data), content_type=MULTIPART_CONTENT
875875
)
@@ -892,7 +892,7 @@ def test_update_devicelocation_change_location_outdoor_to_indoor(self):
892892
}
893893
self.assertEqual(device_location.location.type, "outdoor")
894894
self.assertEqual(device_location.floorplan, None)
895-
with self.assertNumQueries(31):
895+
with self.assertNumQueries(33):
896896
response = self.client.put(
897897
path, encode_multipart(BOUNDARY, data), content_type=MULTIPART_CONTENT
898898
)
@@ -911,7 +911,7 @@ def test_update_devicelocation_patch_indoor(self):
911911
"indoor": "0,0",
912912
}
913913
self.assertEqual(device_location.indoor, "-140.38620,40.369227")
914-
with self.assertNumQueries(18):
914+
with self.assertNumQueries(20):
915915
response = self.client.patch(path, data, content_type="application/json")
916916
self.assertEqual(response.status_code, 200)
917917
device_location.refresh_from_db()
@@ -928,7 +928,7 @@ def test_update_devicelocation_floorplan_related_id(self):
928928
data = {
929929
"floorplan": str(floor2.id),
930930
}
931-
with self.assertNumQueries(20):
931+
with self.assertNumQueries(22):
932932
response = self.client.patch(path, data, content_type='application/json')
933933
self.assertEqual(response.status_code, 200)
934934
device_location.refresh_from_db()
@@ -942,7 +942,7 @@ def test_update_devicelocation_location_related_id(self):
942942
data = {
943943
"location": str(location2.id),
944944
}
945-
with self.assertNumQueries(19):
945+
with self.assertNumQueries(21):
946946
response = self.client.patch(path, data, content_type="application/json")
947947
self.assertEqual(response.status_code, 200)
948948
device_location.refresh_from_db()

0 commit comments

Comments
 (0)