Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openwisp_monitoring/device/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name="api_device_metric_list",
),
path(
"api/v1/monitoring/device/<uuid:pk>/",
"api/v1/monitoring/device/<uuid_any:pk>/",
views.device_metric,
name="api_device_metric",
),
Expand Down
7 changes: 7 additions & 0 deletions openwisp_monitoring/device/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ def test_200_none(self):
def test_200_create(self):
self.create_test_data(no_resources=True)

def test_200_create_uuid_without_dashes(self):
organization = self._create_org()
device = self._create_device(organization=organization)
data = {"type": "DeviceMonitoring", "interfaces": []}
response = self._post_data(device.pk.hex, device.key, data)
self.assertEqual(response.status_code, 200)

@patch("openwisp_monitoring.device.tasks.write_device_metrics.delay")
def test_background_write(self, mocked_task):
device = self._create_device(organization=self._create_org())
Expand Down
Loading