From 750e19ce88492f79e6c43e80d84442c08e5d550f Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Fri, 22 Nov 2024 10:23:03 -0800 Subject: [PATCH] 7848 fix tests --- netbox/core/api/views.py | 1 + netbox/core/tests/test_api.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/netbox/core/api/views.py b/netbox/core/api/views.py index 22c15aa1e..125fcd017 100644 --- a/netbox/core/api/views.py +++ b/netbox/core/api/views.py @@ -112,6 +112,7 @@ class BackgroundQueueViewSet(BaseRQViewSet): """ serializer_class = serializers.BackgroundQueueSerializer lookup_field = 'name' + lookup_value_regex = r'[\w.@+-]+' def get_view_name(self): return "Background Queues" diff --git a/netbox/core/tests/test_api.py b/netbox/core/tests/test_api.py index 5142ded8b..d8fb8fd83 100644 --- a/netbox/core/tests/test_api.py +++ b/netbox/core/tests/test_api.py @@ -146,6 +146,13 @@ class BackgroundTaskTestCase(TestCase): self.assertIn('high', str(response.content)) self.assertIn('low', str(response.content)) + def test_background_queue(self): + response = self.client.get(reverse('core-api:rqqueue-detail', args=['default']), **self.header) + self.assertEqual(response.status_code, 200) + self.assertIn('default', str(response.content)) + self.assertIn('oldest_job_timestamp', str(response.content)) + self.assertIn('scheduled_jobs', str(response.content)) + def test_background_task_list(self): queue = get_queue('default') queue.enqueue(self.dummy_job_default)